PIbd-21_Zaharchenko_M.I._Pi.../Pizzeria/PizzeriaDatabaseImplement/PizzeriaDatabase.cs
2023-04-06 04:11:31 +04:00

24 lines
984 B
C#

using PizzeriaDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
namespace PizzeriaDatabaseImplement
{
public class PizzeriaDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (!optionsBuilder.IsConfigured)
{
optionsBuilder.UseSqlServer(@"Data Source=SHADOWIK\SHADOWIK;Initial Catalog=PizzeriaHardDatabase;Integrated Security=True;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Component> Components { get; set; }
public virtual DbSet<Pizza> Pizzas { get; set; }
public virtual DbSet<PizzaComponent> PizzaComponents { get; set; }
public virtual DbSet<Order> Orders { get; set; }
public virtual DbSet<Shop> Shops { get; set; }
public virtual DbSet<ShopPizzas> ShopPizzas { get; set; }
}
}