32 lines
1.5 KiB
C#
32 lines
1.5 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<OrderCook> OrderCooks { set; get; }
|
|
public virtual DbSet<Dish> Dishes { set; get; }
|
|
public virtual DbSet<Lunch> Lunches { set; get; }
|
|
public virtual DbSet<OrderLunch> 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<LunchProduct> LunchProducts { set; get; }
|
|
public virtual DbSet<DishProduct> DishProducts { set; get; }
|
|
public virtual DbSet<Role> Roles { set; get; }
|
|
public virtual DbSet<Tableware> Tablewares { set; get; }
|
|
public virtual DbSet<Visitor> Visitors { set; get; }
|
|
}
|
|
}
|