mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
add Language data
This commit is contained in:
parent
5719138a8a
commit
80e4429c37
7 changed files with 1705 additions and 4 deletions
1660
data/Language.json
Normal file
1660
data/Language.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -10,13 +10,21 @@ public FilterListsDbContext(DbContextOptions options)
|
|||
{
|
||||
}
|
||||
|
||||
public DbSet<FilterList> FilterList { get; set; }
|
||||
public DbSet<FilterList> FilterLists { get; set; }
|
||||
public DbSet<Maintainer> Maintainers { get; set; }
|
||||
public DbSet<Language> Languages { get; set; }
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<Maintainer>()
|
||||
.Property(b => b.CreatedDateUtc)
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP");
|
||||
modelBuilder.Entity<FilterList>()
|
||||
.Property(b => b.CreatedDateUtc)
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP");
|
||||
modelBuilder.Entity<Language>()
|
||||
.Property(b => b.CreatedDateUtc)
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -5,6 +5,8 @@ namespace FilterLists.Data.Contexts
|
|||
{
|
||||
public interface IFilterListsDbContext
|
||||
{
|
||||
DbSet<FilterList> FilterList { get; set; }
|
||||
DbSet<Maintainer> Maintainers { get; set; }
|
||||
DbSet<FilterList> FilterLists { get; set; }
|
||||
DbSet<Language> Languages { get; set; }
|
||||
}
|
||||
}
|
||||
13
src/FilterLists.Data/Models/Contracts/ILanguage.cs
Normal file
13
src/FilterLists.Data/Models/Contracts/ILanguage.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
namespace FilterLists.Data.Models.Contracts
|
||||
{
|
||||
public interface ILanguage
|
||||
{
|
||||
string Iso6391 { get; set; }
|
||||
string Iso6392 { get; set; }
|
||||
string Iso6392B { get; set; }
|
||||
string Iso6392T { get; set; }
|
||||
string Iso6393 { get; set; }
|
||||
string LocalName { get; set; }
|
||||
string Name { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using System.ComponentModel;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using FilterLists.Data.Models.Contracts;
|
||||
using Newtonsoft.Json;
|
||||
|
|
@ -7,6 +8,8 @@ namespace FilterLists.Data.Models.Implementations
|
|||
{
|
||||
public class FilterList : BaseEntity, IFilterList
|
||||
{
|
||||
public List<ILanguage> FilterLists { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual Maintainer Maintainer { get; set; }
|
||||
|
||||
|
|
|
|||
15
src/FilterLists.Data/Models/Implementations/Language.cs
Normal file
15
src/FilterLists.Data/Models/Implementations/Language.cs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
using FilterLists.Data.Models.Contracts;
|
||||
|
||||
namespace FilterLists.Data.Models.Implementations
|
||||
{
|
||||
public class Language : BaseEntity, ILanguage
|
||||
{
|
||||
public string Iso6391 { get; set; }
|
||||
public string Iso6392 { get; set; }
|
||||
public string Iso6392B { get; set; }
|
||||
public string Iso6392T { get; set; }
|
||||
public string Iso6393 { get; set; }
|
||||
public string LocalName { get; set; }
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -7,7 +7,7 @@ namespace FilterLists.Data.Models.Implementations
|
|||
{
|
||||
public class Maintainer : BaseEntity, IMaintainer
|
||||
{
|
||||
public List<FilterList> FilterLists { get; set; }
|
||||
public List<IFilterList> FilterLists { get; set; }
|
||||
|
||||
[Description(@"The email address of the list maintainer.")]
|
||||
[EmailAddress]
|
||||
|
|
|
|||
Loading…
Reference in a new issue