2023-03-14 08:45:31 +04:00
|
|
|
|
using PizzeriaDatabaseImplement.models;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
|
|
|
|
namespace PizzeriaDatabaseImplement
|
|
|
|
|
{
|
|
|
|
|
public class PizzeriaDatabase : DbContext
|
|
|
|
|
{
|
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
|
|
|
{
|
|
|
|
|
if (optionsBuilder.IsConfigured == false)
|
|
|
|
|
{
|
|
|
|
|
optionsBuilder.UseNpgsql(@"Host=localhost;Port=5432;Database=PizzeriaDatabase;Username=postgres;Password=postgres");
|
|
|
|
|
}
|
|
|
|
|
base.OnConfiguring(optionsBuilder);
|
|
|
|
|
}
|
|
|
|
|
public virtual DbSet<Component> Components { set; get; }
|
|
|
|
|
public virtual DbSet<Pizza> Pizzas { set; get; }
|
2023-04-23 20:30:20 +04:00
|
|
|
|
public virtual DbSet<Shop> Shops { set; get; }
|
2023-03-14 08:45:31 +04:00
|
|
|
|
public virtual DbSet<PizzaComponent> PizzaComponents { set; get; }
|
2023-04-23 20:30:20 +04:00
|
|
|
|
public virtual DbSet<ShopPizza> ShopPizzas { set; get; }
|
2023-03-14 08:45:31 +04:00
|
|
|
|
public virtual DbSet<Order> Orders { set; get; }
|
|
|
|
|
}
|
|
|
|
|
}
|