This commit is contained in:
Maksim Chegulov 2021-10-07 12:49:55 +03:00
parent d0f630ccea
commit 814fe65535
2 changed files with 40 additions and 0 deletions

View File

@ -1,4 +1,6 @@

using Microsoft.EntityFrameworkCore;
namespace ASC.Core.Common.EF.Model.Mail
{
public class GreyListingWhiteList
@ -6,4 +8,21 @@ namespace ASC.Core.Common.EF.Model.Mail
public string Comment { get; set; }
public string Source { get; set; }
}
public static class GreyListingWhiteListExtension
{
public static ModelBuilderWrapper AddGreyListingWhiteList(this ModelBuilderWrapper modelBuilder)
{
modelBuilder
.Add(MySqlAddGreyListingWhiteList, Provider.MySql);
return modelBuilder;
}
public static void MySqlAddGreyListingWhiteList(this ModelBuilder modelBuilder)
{
modelBuilder.Entity<GreyListingWhiteList>()
.HasKey(e => e.Comment);
}
}
}

View File

@ -1,4 +1,6 @@

using Microsoft.EntityFrameworkCore;
namespace ASC.Core.Common.EF.Model
{
public class Regions
@ -8,4 +10,23 @@ namespace ASC.Core.Common.EF.Model
public string ConnectionString { get; set; }
}
public static class RegionsExtension
{
public static ModelBuilderWrapper AddRegions(this ModelBuilderWrapper modelBuilder)
{
modelBuilder
.Add(MySqlAddRegions, Provider.MySql);
return modelBuilder;
}
public static void MySqlAddRegions(this ModelBuilder modelBuilder)
{
modelBuilder.Entity<Regions>(entity =>
{
entity.HasKey(e => e.Region);
});
}
}
}