20 lines
577 B
C#
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; }
|
|||
|
}
|
|||
|
}
|