namespace Server.DB; using Documents; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; public class WonderkingContext : DbContext { private readonly IConfiguration _configuration; private readonly ILoggerFactory _loggerFactory; public WonderkingContext(ILoggerFactory loggerFactory, IConfiguration configuration) { this._loggerFactory = loggerFactory; this._configuration = configuration; } public DbSet Accounts { get; set; } public DbSet Characters { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) => optionsBuilder .UseNpgsql( $"Host={this._configuration["DB:Host"]};Username={this._configuration["DB:Username"]};Password={this._configuration["DB:Password"]};Database={this._configuration["DB:Database"]};Port={this._configuration["DB:Port"]}") .EnableSensitiveDataLogging().UseLoggerFactory(this._loggerFactory); }