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

20 lines
577 B
C#
Raw Permalink Normal View History

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; }
}
}