using Manager.Data.Models.ApplicationContext; using Microsoft.EntityFrameworkCore; namespace Manager.Data.Contexts; public sealed class ApplicationDbContext : DbContext { public ApplicationDbContext(DbContextOptions options) : base(options) { ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking; ChangeTracker.LazyLoadingEnabled = false; } public DbSet SettingsGroups { get; set; } public DbSet Settings { get; set; } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity(sg => { sg.ToTable("settings_groups"); sg.HasKey(x => x.Id); }); modelBuilder.Entity(settingsEntity => { settingsEntity.ToTable("settings"); settingsEntity.HasKey(x => x.Key); }); base.OnModelCreating(modelBuilder); } }