2024-04-30 20:14:53 +04:00
|
|
|
|
using CarCenterDatabaseImplement.Models;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
|
|
|
|
namespace CarCenterDatabaseImplement
|
2024-04-30 18:30:17 +04:00
|
|
|
|
{
|
2024-04-30 20:14:53 +04:00
|
|
|
|
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);
|
|
|
|
|
}
|
2024-04-30 18:30:17 +04:00
|
|
|
|
|
2024-04-30 20:14:53 +04:00
|
|
|
|
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; }
|
|
|
|
|
}
|
2024-04-30 18:30:17 +04:00
|
|
|
|
}
|