PIbd-21_Medvedkov_Coursach/ComputerShopDatabaseImplement/ComputerShopDatabase.cs
2024-05-01 04:42:57 +04:00

33 lines
1.0 KiB
C#

using ComputerShopDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
namespace ComputerShopDatabaseImplement
{
public class ComputerShopDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder OptionsBuilder)
{
if (!OptionsBuilder.IsConfigured)
{
OptionsBuilder.UseSqlServer(@"Data Source=localhost\SQLEXPRESS;Initial Catalog=ComputerStoreDatabaseFull;Integrated Security=True;MultipleActiveResultSets=True;TrustServerCertificate=True");
}
base.OnConfiguring(OptionsBuilder);
}
public virtual DbSet<User> Users { get; set; }
public virtual DbSet<Component> Components { get; set; }
public virtual DbSet<Assembly> Assemblies { get; set; }
public virtual DbSet<AssemblyComponent> AssemblyComponents { get; set; }
public virtual DbSet<Product> Products { get; set; }
public virtual DbSet<Request> Requests { get; set; }
public virtual DbSet<Batch> Batchs { get; set; }
}
}