PIbd-23-Salin-O.A.-IceCream.../IceCreamShop/IceCreamShopDatabaseImplement/IceCreamShopDataBase.cs

33 lines
1.2 KiB
C#
Raw Normal View History

2024-03-04 19:46:39 +04:00
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)
{
2024-03-24 11:51:50 +04:00
optionsBuilder.UseSqlServer(@"Data Source=localhost\SQLEXPRESS;Initial Catalog=IceCreamShopHardDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
2024-03-04 19:46:39 +04:00
}
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; }
2024-03-18 19:22:56 +04:00
public virtual DbSet<Shop> Shops { set; get; }
public virtual DbSet<ShopIceCream> ShopIceCreams { set; get; }
2024-04-01 20:04:44 +04:00
public virtual DbSet<Client> Clients { set; get; }
2024-03-04 19:46:39 +04:00
}
}