18 lines
602 B
C#
18 lines
602 B
C#
using DatabaseImplement.Models;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace DatabaseImplement
|
|
{
|
|
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; }
|
|
}
|
|
} |