2023-06-04 03:46:48 +04:00
|
|
|
|
using GiftShopDatabaseImplement.Models;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace GiftShopDatabaseImplement
|
|
|
|
|
{
|
|
|
|
|
public class GiftShopDatabase : DbContext
|
|
|
|
|
{
|
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder
|
|
|
|
|
optionsBuilder)
|
|
|
|
|
{
|
|
|
|
|
if (optionsBuilder.IsConfigured == false)
|
|
|
|
|
{
|
2023-06-04 03:50:20 +04:00
|
|
|
|
optionsBuilder.UseSqlServer(@"Data Source=WIN-NDB4BTR4EIB;Initial Catalog=GiftShopDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
2023-06-04 03:46:48 +04:00
|
|
|
|
}
|
|
|
|
|
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; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|