ISEbd-21.Gordeev.I.V.SushiB.../SushiBar/SushiBarDatabaseImplement/SushiBarDatabase.cs

26 lines
885 B
C#
Raw Normal View History

2024-04-03 16:59:01 +04:00
using Microsoft.EntityFrameworkCore;
using SushiBarDatabaseImplement.Models;
namespace SushiBarDatabaseImplement
{
public class SushiBarDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-E2VPEN3\SQLEXPRESS;Initial Catalog=SushiBarDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Ingredient> Ingredients { set; get; }
public virtual DbSet<Sushi> ListSushi { set; get; }
public virtual DbSet<SushiIngredient> SushiIngredients { set; get; }
public virtual DbSet<Order> Orders { set; get; }
}
}