using Clarity.Server.Entity; using Microsoft.EntityFrameworkCore; namespace Clarity.Server.Data { public class ApplicationDbContext : DbContext { public DbSet Profiles => Set(); public DbSet SysParams => Set(); public ApplicationDbContext(DbContextOptions options) : base(options) { } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity(entity => { entity.HasKey(p => p.Id); entity.HasIndex(p => p.KeycloakSubject).IsUnique(); entity.Property(p => p.KeycloakSubject).IsRequired(); }); } } }