PIbd21_Makarov_DV_FlowerShop/FlowerShop/FlowerShopDatabaseImplement/FlowerShopDatabase.cs

26 lines
1.1 KiB
C#
Raw Normal View History

2024-03-09 17:32:17 +04:00
using FlowerShopDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
namespace FlowerShopDatabaseImplement
{
public class FlowerShopDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
2024-04-25 20:09:08 +04:00
optionsBuilder.UseNpgsql(@"Host=localhost;Database=FlowerShopHardDatabaseFull;Username=postgres;Password=postgres");
2024-04-04 00:39:31 +04:00
optionsBuilder.UseNpgsql(@"Host=localhost;Database=FlowerShopDatabaseFull;Username=postgres;Password=postgres");
2024-03-09 17:32:17 +04:00
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Component> Components { set; get; }
public virtual DbSet<Flower> Flowers { set; get; }
public virtual DbSet<FlowerComponent> FlowerComponents { set; get; }
public virtual DbSet<Order> Orders { set; get; }
2024-04-25 20:09:08 +04:00
public virtual DbSet<Shop> Shops { set; get; }
public virtual DbSet<ShopFlower> ShopFlowers { set; get; }
2024-04-04 18:22:29 +04:00
public virtual DbSet<Client> Clients { set; get; }
2024-03-09 17:32:17 +04:00
}
}