ISEbd-21_Khaliullov_R.A._Co.../Canteen/CanteenDatabaseImplement/CanteenDatabase.cs

31 lines
1.1 KiB
C#
Raw Normal View History

2024-04-30 18:48:42 +04:00
using CanteenDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.ConstrainedExecution;
using System.Text;
using System.Threading.Tasks;
namespace CanteenDatabaseImplement
{
public class CanteenDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-F29MRPU\SQLEXPRESS;Initial Catalog=CanteenDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Ingredient> Ingredients { set; get; }
public virtual DbSet<Dish> Dishes { set; get; }
public virtual DbSet<DishIngredient> DishIngredients { set; get; }
public virtual DbSet<Order> Orders { set; get; }
public virtual DbSet<Client> Clients { set; get; }
public virtual DbSet<Cook> Cooks { set; get; }
}
}