PIbd-23-Radaev-A.V.-GiftShop/GiftShop/GiftShopDatabaseImplement/GiftShopDatabase.cs
Arkadiy Radaev d0874b7c11 res 4 hard
2024-05-18 18:05:46 +04:00

30 lines
1018 B
C#

using GiftShopDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
namespace GiftShopDatabaseImplement
{
public class GiftShopDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-Arkad1y;Initial Catalog=GiftShopDataBaseHard;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Component> Components { set; get; }
public virtual DbSet<Gift> Gifts { set; get; }
public virtual DbSet<GiftComponent> GiftComponents { set; get; }
public virtual DbSet<Order> Orders { set; get; }
public virtual DbSet<Shop> Shops { set; get; }
public virtual DbSet<ShopGift> ShopGifts { set; get;}
}
}