PIbd-23_Abazov_A.A._Confect.../Confectionery/ConfectioneryDataBaseImplement/ConfectioneryDatabase.cs

30 lines
1.1 KiB
C#

using ConfectioneryDataBaseImplement.Models;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConfectioneryDataBaseImplement
{
public class ConfectioneryDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"Data Source=localhost\SQLEXPRESS;Initial Catalog=ConfectioneryDatabaseHardLab;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Ingredient> Ingredients { set; get; }
public virtual DbSet<Pastry> Pastrys { set; get; }
public virtual DbSet<PastryIngredient> PastryIngredients { set; get; }
public virtual DbSet<Order> Orders { set; get; }
public virtual DbSet<Shop> Shops { set; get; }
public virtual DbSet<ShopPastry> ShopPastries { set; get; }
}
}