26 lines
895 B
C#
26 lines
895 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=GiftShopDatabase;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; }
|
|||
|
}
|
|||
|
}
|