ComputerHardwareStore_YouAr.../ComputerHardwareStore/ComputerHardwareStoreDatabaseImplement/ComputerHardwareStoreDBContext.cs

32 lines
1.5 KiB
C#
Raw Normal View History

2024-04-29 21:02:41 +04:00
using ComputerHardwareStoreDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
namespace ComputerHardwareStoreDatabaseImplement
{
public class ComputerHardwareStoreDBContext : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
2024-05-01 18:38:59 +04:00
optionsBuilder.UseNpgsql("Host=192.168.1.61:5432;Database=computerhardwarestore;Username=compstore;Password=compstore");
2024-04-29 21:02:41 +04:00
base.OnConfiguring(optionsBuilder);
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true);
}
public virtual DbSet<Component> Components { set; get; }
public virtual DbSet<Product> Products { set; get; }
public virtual DbSet<ProductComponent> ProductComponents { set; get; }
2024-04-30 15:57:30 +04:00
public virtual DbSet<StoreKeeper> StoreKeepers { set; get; }
public virtual DbSet<Build> Builds { set; get; }
2024-04-30 19:53:37 +04:00
public virtual DbSet<Order> Orders { set; get; }
2024-04-30 18:59:45 +04:00
public virtual DbSet<OrderProduct> OrderProducts { set; get; }
public virtual DbSet<BuildComponent> BuildComponents { set; get; }
public virtual DbSet<Comment> Comments { set; get; }
2024-04-30 19:43:16 +04:00
public virtual DbSet<Vendor> Vendors { set; get; }
2024-04-30 19:12:40 +04:00
public virtual DbSet<Purchase> Purchases { set; get; }
public virtual DbSet<PurchaseBuild> PurchaseBuilds { set; get; }
public virtual DbSet<PurchaseProduct> PurchaseProducts { set; get; }
2024-04-29 21:02:41 +04:00
}
}