using Microsoft.EntityFrameworkCore; using SushiBarDatabaseImplement.Models; namespace SushiBarDatabaseImplement { public class SushiBarDatabase : DbContext { protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { if (optionsBuilder.IsConfigured == false) { optionsBuilder.UseNpgsql(@"Host=localhost;Database=SushiBar_db7;Username=postgres;Password=postgres"); } base.OnConfiguring(optionsBuilder); AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true); } public virtual DbSet Components { set; get; } public virtual DbSet Sushis { set; get; } public virtual DbSet SushiComponents { set; get; } public virtual DbSet Orders { set; get; } public virtual DbSet Clients { set; get; } public virtual DbSet Implementers { set; get; } public virtual DbSet Messages { set; get; } } }