ISEbd-21_Kuklew_M.I._Chegod.../CarCenterDatabaseImplement/CarCenterDb.cs
Максим Куклев 3156a6d518 сссююда готово
2024-04-30 20:14:53 +04:00

33 lines
1.1 KiB
C#

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; }
}
}