PIbd-23-Salin-O.A.-IceCream.../IceCreamShop/IceCreamShopDatabaseImplement/IceCreamShopDataBase.cs
gg12 darfren 0a0387d380 слил
2024-04-14 11:36:11 +04:00

33 lines
1.2 KiB
C#

using IceCreamShopDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IceCreamShopDatabaseImplement
{
public class IceCreamShopDataBase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder
optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"Data Source=localhost\SQLEXPRESS;Initial Catalog=IceCreamShopHardDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Models.Component> Components { set; get; }
public virtual DbSet<IceCream> IceCreams { set; get; }
public virtual DbSet<IceCreamComponent> IceCreamComponents { set; get; }
public virtual DbSet<Order> Orders { set; get; }
public virtual DbSet<Shop> Shops { set; get; }
public virtual DbSet<ShopIceCream> ShopIceCreams { set; get; }
public virtual DbSet<Client> Clients { set; get; }
}
}