using ComputerShopDatabaseImplement.Models; using Microsoft.EntityFrameworkCore; namespace ComputerShopDatabaseImplement { public class ComputerShopDatabase : DbContext { protected override void OnConfiguring(DbContextOptionsBuilder OptionsBuilder) { if (!OptionsBuilder.IsConfigured) { OptionsBuilder.UseNpgsql(@"Host=localhost;Port=5000;Database=ComputerShop;Username=postgres;Password=admin"); } 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 Assemblies { get; set; } public virtual DbSet AssemblyComponents { get; set; } public virtual DbSet Products { get; set; } public virtual DbSet ProductComponents { get; set; } public virtual DbSet Orders { get; set; } public virtual DbSet Requests { get; set; } public virtual DbSet Shipments { get; set; } public virtual DbSet ShipmentOrders { get; set; } public virtual DbSet RequestOrders { get; set; } } }