PIbd21_Makarov_DV_FlowerShop/FlowerShop/FlowerShopDatabaseImplement/FlowerShopDatabase.cs

22 lines
884 B
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)
{
optionsBuilder.UseSqlServer(@"Data Source=WHITEBEAR\SQLEXPRESS;Initial Catalog=FlowerShopDatabaseFull;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
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; }
}
}