using ComputerHardwareStoreDatabaseImplement.Models; using Microsoft.EntityFrameworkCore; namespace ComputerHardwareStoreDatabaseImplement { public class ComputerHardwareStoreDBContext : DbContext { protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { //optionsBuilder.UseNpgsql("Host=192.168.1.61:5432;Database=computerhardwarestore;Username=compstore;Password=compstore"); optionsBuilder.UseNpgsql("Host=localhost;Port=5432;Database=ComputerHardwareStore;Username=postgres;Password=postgres"); AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); } public virtual DbSet Components { set; get; } public virtual DbSet Products { set; get; } public virtual DbSet ProductComponents { set; get; } public virtual DbSet StoreKeepers { set; get; } public virtual DbSet Builds { set; get; } public virtual DbSet Orders { set; get; } public virtual DbSet OrderProducts { set; get; } public virtual DbSet BuildComponents { set; get; } public virtual DbSet Comments { set; get; } public virtual DbSet Vendors { set; get; } public virtual DbSet Purchases { set; get; } public virtual DbSet PurchaseBuilds { set; get; } public virtual DbSet PurchaseProducts { set; get; } } }