2023-11-01 21:19:02 +04:00
|
|
|
|
using DataBaseImplement.Models;
|
2023-11-01 21:10:48 +04:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
2023-11-01 21:19:02 +04:00
|
|
|
|
namespace DataBaseImplement
|
2023-11-01 21:10:48 +04:00
|
|
|
|
{
|
|
|
|
|
public class DBContext:DbContext
|
|
|
|
|
{
|
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
|
|
|
{
|
|
|
|
|
if(!optionsBuilder.IsConfigured)
|
|
|
|
|
optionsBuilder.UseNpgsql(@"Host=localhost;Port=5432;Database=COP;Username=courseuser;Password=courseuser");
|
|
|
|
|
base.OnConfiguring(optionsBuilder);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public virtual DbSet<Provider> Providers { get; set; }
|
|
|
|
|
public virtual DbSet<Models.Type> Types { get; set; }
|
|
|
|
|
}
|
|
|
|
|
}
|