using DiningRoomDatabaseImplement.Models; using Microsoft.EntityFrameworkCore; namespace DiningRoomDatabaseImplement { public class DiningRoomDatabase : DbContext { protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { if (optionsBuilder.IsConfigured == false) { optionsBuilder.UseNpgsql(@"Host=localhost;Port=5432;Database=DiningRoomDatabase;Username=postgres;Password=postgres"); } base.OnConfiguring(optionsBuilder); AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true); } public virtual DbSet Users { get; set; } public virtual DbSet Components { get; set; } public virtual DbSet Drinks { get; set; } public virtual DbSet DrinkComponents { get; set; } public virtual DbSet Products { get; set; } public virtual DbSet ProductComponents { get; set; } public virtual DbSet Orders { get; set; } public virtual DbSet Cards { get; set; } } }