25 lines
1.0 KiB
C#
25 lines
1.0 KiB
C#
using SoftwareInstallationDatabaseImplement.Models;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using System.Collections.Generic;
|
|
|
|
namespace SoftwareInstallationDatabaseImplement
|
|
{
|
|
public class SoftwareInstallationDatabase : DbContext
|
|
{
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
{
|
|
if (!optionsBuilder.IsConfigured)
|
|
{
|
|
optionsBuilder.UseSqlServer(@"Data Source=LAPTOP-952S2NGN;Initial Catalog=SoftHard;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
|
}
|
|
base.OnConfiguring(optionsBuilder);
|
|
}
|
|
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; }
|
|
}
|
|
}
|