PIbd-32_Turner_I.A._COP_10/COP/ClientsDatabaseImplement/ClientsDatabase.cs

20 lines
577 B
C#

using Microsoft.EntityFrameworkCore;
using ClientsDatabaseImplement.Models;
namespace ClientsDatabaseImplement
{
public class ClientsDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseNpgsql(@"Host=localhost;Port=5432;Database=ClientsDatabase;Username=postgres;Password=186qazwsx");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Client> Clients { set; get; }
public virtual DbSet<Status> Statuses { set; get; }
}
}