Coursach/Course/DatabaseImplement/FactoryGoWorkDatabase.cs
2024-04-27 12:35:20 +04:00

26 lines
1.1 KiB
C#

using DatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
namespace DatabaseImplement
{
public class FactoryGoWorkDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseNpgsql("Host=localhost;Port=5432;Database=GoWorkDB;Username=postgres;Password=postgres");
}
public virtual DbSet<Product> Products { get; set; }
public virtual DbSet<Detail> Details { get; set; }
public virtual DbSet<DetailProduct> DetailProducts { get; set; }
public virtual DbSet<Production> Productions { get; set; }
public virtual DbSet<DetailProduction> DetailProductions { get; set; }
public virtual DbSet<Implementer> Implementers { get; set; }
public virtual DbSet<Guarantor> Guarantors { get; set; }
public virtual DbSet<Machine> Machines { get; set; }
public virtual DbSet<WorkerMachine> WorkerMachines { get; set; }
public virtual DbSet<Worker> Workers { get; set; }
public virtual DbSet<Workshop> Workshops { get; set; }
public virtual DbSet<WorkerWorkshop> WorkerWorkshops { get; set; }
}
}