using Microsoft.EntityFrameworkCore; using SushiBarDatabaseImplement.Models; using System; using System.Collections.Generic; using System.Data.Common; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SushiBarDatabaseImplement { public class SushiBarDatabase : DbContext { protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { if (optionsBuilder.IsConfigured == false) { optionsBuilder.UseNpgsql(@"Host=localhost;Database=SUBDLab8;Username=postgres;Password=shotboll200412"); } base.OnConfiguring(optionsBuilder); AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true); } //optionsBuilder.UseNpgsql(@"Host=localhost;Database=ComputersShop_db;Username=postgres;Password=postgres"); public virtual DbSet Buyers { get; set; } public virtual DbSet Cooks { get; set; } public virtual DbSet Menus { get; set; } public virtual DbSet Places { get; set; } public virtual DbSet Tasks { get; set; } public virtual DbSet TaskMenus { get; set; } } }