30 lines
1.0 KiB
C#
Raw Permalink Normal View History

2024-04-07 17:40:43 +04:00
using Microsoft.EntityFrameworkCore;
using SoftwareInstallationDatabaseImplement.Models;
2024-04-07 17:24:16 +04:00
using System;
using System.Collections.Generic;
2024-04-07 17:40:43 +04:00
using System.Diagnostics;
2024-04-07 17:24:16 +04:00
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SoftwareInstallationDatabaseImplement
2024-04-07 17:40:43 +04:00
{
2024-04-07 17:24:16 +04:00
public class SoftwareInstallationDataBase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder
optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
2024-04-07 17:40:43 +04:00
optionsBuilder.UseSqlServer(@"Data Source=LAPTOP-952S2NGN;Initial Catalog=Software;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
2024-04-07 17:24:16 +04:00
}
base.OnConfiguring(optionsBuilder);
}
2024-04-07 17:40:43 +04:00
public virtual DbSet<Component> Components { set; get; }
public virtual DbSet<Software> Softwares { set; get; }
public virtual DbSet<PackageComponent> SoftwareComponents { set; get; }
2024-04-07 17:24:16 +04:00
public virtual DbSet<Order> Orders { set; get; }
}
}