33 lines
1.1 KiB
C#
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; }
|
|
}
|
|
}
|