23 lines
872 B
C#
23 lines
872 B
C#
|
using Microsoft.EntityFrameworkCore;
|
|||
|
using PizzeriaDatabaseImplement.Models;
|
|||
|
|
|||
|
namespace PizzeriaDatabaseImplement
|
|||
|
{
|
|||
|
public class PizzeriaDatabase : DbContext
|
|||
|
{
|
|||
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|||
|
{
|
|||
|
if (optionsBuilder.IsConfigured == false)
|
|||
|
{
|
|||
|
optionsBuilder.UseSqlServer(@"Data Source=KOMPUTER\SQLEXPRESS;Initial Catalog=PizzeriaDatabaseFull;Integrated Security=True;MultipleActiveResultSets=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; }
|
|||
|
|
|||
|
}
|
|||
|
}
|