SUBD_Labs/BeautySalonDatabaseImplement/BeautySalonDatabase.cs

23 lines
870 B
C#
Raw Normal View History

using BeautySalonDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
namespace BeautySalonDatabaseImplement
{
public class BeautySalonDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
2023-05-17 02:04:30 +04:00
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; }
}
}