сссююда готово

This commit is contained in:
Максим Куклев 2024-04-30 20:14:53 +04:00
parent f4f0834859
commit 3156a6d518

View File

@ -1,7 +1,32 @@
namespace CarCenterDatabaseImplement
{
public class Class1
{
using CarCenterDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
}
namespace CarCenterDatabaseImplement
{
public class CarCenterDb : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseNpgsql(@"
Host=localhost;
Port=5432;
Database=CarCenter;
Username=postgres;
Password=postgres;
Include Error Detail=true");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Implementer> Implementers { set; get; }
public virtual DbSet<Requirement> Requirements { set; get; }
public virtual DbSet<RequirementByCar> RequirementByCars { set; get; }
public virtual DbSet<Director> Directors { set; get; }
public virtual DbSet<Client> Clients { set; get; }
public virtual DbSet<ClientByCar> ClientsByCars { set; get; }
public virtual DbSet<Account> Accounts { set; get; }
public virtual DbSet<Car> Cars { set; get; }
}
}