PIbd-21_Zaharchenko_M.I._Pi.../Pizzeria/PizzeriaDatabaseImplement/PizzeriaDatabase.cs

22 lines
845 B
C#
Raw Normal View History

2023-03-09 04:09:42 +04:00
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(@"Server=shadowik;Initial Catalog=PizzeriaDatabase;Integrated Security=True;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Component> Components { set; get; }
public virtual DbSet<Pizza> Pizzas { set; get; }
public virtual DbSet<PizzaComponent> PizzaComponents { set; get; }
public virtual DbSet<Order> Orders { set; get; }
}
}