DocSpace-buildtools/common/ASC.Core.Common/EF/Model/Regions.cs

33 lines
795 B
C#
Raw Normal View History

2021-02-25 09:00:53 +00:00

2021-10-07 09:49:55 +00:00
using Microsoft.EntityFrameworkCore;
2019-12-17 08:27:38 +00:00
namespace ASC.Core.Common.EF.Model
{
public class Regions
{
public string Region { get; set; }
public string Provider { get; set; }
public string ConnectionString { get; set; }
}
2021-10-07 09:49:55 +00:00
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);
});
}
}
2019-12-17 08:27:38 +00:00
}