уникальность для полей безопасности

This commit is contained in:
kotcheshir73 2021-04-02 22:21:34 +04:00
parent f8bbebe473
commit edd0dc9fdb

View File

@ -26,6 +26,10 @@ namespace DatabaseCore
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<EnviromentSetting>().HasIndex(s => s.Key).IsUnique();
modelBuilder.Entity<Role>().HasIndex(s => s.RoleName).IsUnique();
modelBuilder.Entity<User>().HasIndex(s => s.UserName).IsUnique();
}