diff --git a/CarCenterDatabaseImplement/CarCenterDb.cs b/CarCenterDatabaseImplement/CarCenterDb.cs index b9926a6..e30d474 100644 --- a/CarCenterDatabaseImplement/CarCenterDb.cs +++ b/CarCenterDatabaseImplement/CarCenterDb.cs @@ -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 Implementers { set; get; } + public virtual DbSet Requirements { set; get; } + public virtual DbSet RequirementByCars { set; get; } + public virtual DbSet Directors { set; get; } + public virtual DbSet Clients { set; get; } + public virtual DbSet ClientsByCars { set; get; } + public virtual DbSet Accounts { set; get; } + public virtual DbSet Cars { set; get; } + } }