PIbd-21_BatylkinaAO_MusoevD.../Canteen/CanteenDatabaseImplement/CanteenDatabase.cs
2023-04-07 10:55:40 +04:00

31 lines
1.4 KiB
C#

using CanteenDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
namespace CanteenDatabaseImplement
{
public class CanteenDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-AOSK1F5\SQLEXPRESS;Initial Catalog=CanteenDataBase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Cook> Cooks { set; get; }
public virtual DbSet<CookOrder> OrderCooks { set; get; }
public virtual DbSet<Dish> Dishes { set; get; }
public virtual DbSet<Lunch> Lunches { set; get; }
public virtual DbSet<LunchOrder> OrderLunches { set; get; }
public virtual DbSet<Manager> Managers { set; get; }
public virtual DbSet<Order> Orders { set; get; }
public virtual DbSet<Product> Products { set; get; }
public virtual DbSet<ProductCook> ProductCooks { set; get; }
public virtual DbSet<ProductLunch> LunchProducts { set; get; }
public virtual DbSet<Role> Roles { set; get; }
public virtual DbSet<Tableware> Tablewares { set; get; }
public virtual DbSet<Visitor> Visitors { set; get; }
}
}