SUBD_Labs/BeautySalonDatabaseImplement/BeautySalonDatabase.cs

23 lines
870 B
C#

using BeautySalonDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
namespace BeautySalonDatabaseImplement
{
public class BeautySalonDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseNpgsql("Host=192.168.56.102;Port=5432;Database=BeautySalonDatabase;Username=postgres;Password=12345");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Master> Masters { set; get; }
public virtual DbSet<Service> Services { set; get; }
public virtual DbSet<MasterService> MasterServices { set; get; }
public virtual DbSet<Visit> Visits { set; get; }
public virtual DbSet<Client> Clients { set; get; }
}
}