using PortalAccountsDatabaseImplement.Models; using Microsoft.EntityFrameworkCore; namespace PortalAccountsDatabaseImplement { public class PortalAccountsDatabase : DbContext { protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { if (optionsBuilder.IsConfigured == false) { optionsBuilder.UseNpgsql(@"Host=localhost;Database=portal_accounts_database;Username=postgres;Password=bythop423956"); } base.OnConfiguring(optionsBuilder); AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true); } public virtual DbSet Accounts { set; get; } public virtual DbSet Roles { set; get; } } }