using Microsoft.EntityFrameworkCore; using ROLAC.API.Entities.Logging; namespace ROLAC.API.Data.Logging; /// /// A minimal, write-mostly context dedicated to the SystemLog / AuditLog tables. It is the /// structural break that prevents log-storms: it is registered WITHOUT the audit interceptors /// and with a silent logger factory (see Program.cs), so persisting a log row produces no log /// events that the DB sink would pick up. It shares the same physical database/connection as /// AppDbContext, but the tables themselves are created by AppDbContext's migration — they are /// only mapped here so this context can read/write them. /// public class LogDbContext : DbContext { public LogDbContext(DbContextOptions options) : base(options) { } public DbSet SystemLogs => Set(); public DbSet AuditLogs => Set(); protected override void OnModelCreating(ModelBuilder builder) { base.OnModelCreating(builder); LogModelConfiguration.Configure(builder); } }