ISEbd_21_Kuklew_M.I._Softwa.../SoftwareInstallationDatabaseImplement/SoftwareInstallationDataBase.cs

25 lines
1.0 KiB
C#
Raw Normal View History

2024-04-07 17:24:16 +04:00
using SoftwareInstallationDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
namespace SoftwareInstallationDatabaseImplement
2024-05-12 14:45:39 +04:00
{
public class SoftwareInstallationDatabase : DbContext
2024-04-07 17:24:16 +04:00
{
2024-05-12 14:45:39 +04:00
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
2024-04-07 17:24:16 +04:00
{
2024-05-12 14:45:39 +04:00
if (!optionsBuilder.IsConfigured)
2024-04-07 17:24:16 +04:00
{
2024-05-12 14:45:39 +04:00
optionsBuilder.UseSqlServer(@"Data Source=LAPTOP-952S2NGN;Initial Catalog=SoftHard;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
2024-04-07 17:24:16 +04:00
}
base.OnConfiguring(optionsBuilder);
}
2024-05-12 14:45:39 +04:00
public virtual DbSet<Component> Components { get; set; }
public virtual DbSet<Package> Packages { get; set; }
public virtual DbSet<PackageComponent> PackageComponents { get; set; }
public virtual DbSet<Order> Orders { get; set; }
public virtual DbSet<Shop> Shops { get; set; }
public virtual DbSet<ShopPackages> ShopPackages { get; set; }
2024-04-07 17:24:16 +04:00
}
}