Use async DB queries.

This commit is contained in:
Pieter-Jan Briers
2020-06-26 03:46:08 +02:00
parent 357c110535
commit 579ff6bb26
20 changed files with 656 additions and 148 deletions

View File

@@ -53,12 +53,17 @@ namespace Content.Server.Database
}
public DbSet<Prefs> Preferences { get; set; } = null!;
public DbSet<HumanoidProfile> HumanoidProfile { get; set; } = null!;
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Prefs>()
.HasIndex(p => p.Username)
.IsUnique();
modelBuilder.Entity<HumanoidProfile>()
.HasIndex(p => new {p.Slot, p.PrefsId})
.IsUnique();
}
}