PIbd_23_Kislitsa_E.D_Diner/Diner/DinerDataBaseImplement/DinerDatabase.cs
2024-04-16 13:03:58 +04:00

24 lines
985 B
C#

using DinerDataBaseImplement.Models;
using Microsoft.EntityFrameworkCore;
namespace DinerDataBaseImplement
{
public class DinerDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"Data Source=localhost\SQLEXPRESS0;Initial Catalog=DinerDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Component> Components { set; get; }
public virtual DbSet<Snack> Snacks { set; get; }
public virtual DbSet<SnackComponent> SnackComponents { set; get; }
public virtual DbSet<Order> Orders { set; get; }
public virtual DbSet<Client> Clients { set; get; }
public virtual DbSet<Implementer> Implementers { set; get; }
}
}