PIbd-23_Ivanov_V.N._Pizzeria/Pizzeria/PizzeriaDatabaseImplement/PizzeriaDatabase.cs

25 lines
1021 B
C#
Raw Normal View History

2024-03-04 23:06:34 +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(@"Data Source=LAPTOP-M2G96S06\SQLEXPRESS;Initial Catalog=PizzeriaDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
2024-03-05 09:41:24 +04:00
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; }
2024-03-04 23:06:34 +04:00
}
}