24 lines
1019 B
C#
24 lines
1019 B
C#
|
using BarberShopDatabaseImplement.Models;
|
|||
|
using Microsoft.EntityFrameworkCore;
|
|||
|
|
|||
|
namespace BarberShopDatabaseImplement
|
|||
|
{
|
|||
|
public class BarberShopDatabase : DbContext
|
|||
|
{
|
|||
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|||
|
{
|
|||
|
if (optionsBuilder.IsConfigured == false)
|
|||
|
{
|
|||
|
optionsBuilder.UseSqlServer(@"Data Source=localhost\SQLEXPRESS;Initial Catalog=BarberShopDataBase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
|||
|
}
|
|||
|
base.OnConfiguring(optionsBuilder);
|
|||
|
}
|
|||
|
|
|||
|
public virtual DbSet<Client> Clients { get; set; }
|
|||
|
public virtual DbSet<Employee> Employees { get; set; }
|
|||
|
public virtual DbSet<Component> Components { get; set; }
|
|||
|
public virtual DbSet<ServiceComponent> ServiceComponents { get; set; }
|
|||
|
public virtual DbSet<Service> Services { get; set; }
|
|||
|
public virtual DbSet<Appointment> Appointments { get; set; }
|
|||
|
}
|
|||
|
}
|