Coursework_ComputerStore_Li.../ComputerStoreDatabaseImplement/ComputerStoreDatabase.cs

35 lines
1.4 KiB
C#
Raw Normal View History

using ComputerStoreDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ComputerStoreDatabaseImplement
{
public class ComputerStoreDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
2023-05-17 18:34:28 +04:00
optionsBuilder.UseSqlServer(@"Data Source=YUEEJKE\SQLEXPRESS;Initial Catalog=ComputerStoreDatabase;Integrated Security=True;MultipleActiveResultSets=True;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Component> Components { get; set; }
public virtual DbSet<Product> Products { get; set; }
public virtual DbSet<PC> PCs { get; set; }
public virtual DbSet<Employee> Employees { get; set; }
public virtual DbSet<RequestComponent> RequestComponents { get; set; }
2023-04-07 21:49:30 +04:00
public virtual DbSet<ProductComponent> ProductComponents { get; set; }
2023-04-09 01:07:38 +04:00
public virtual DbSet<ConsignmentProduct> ConsignmentProducts { get; set; }
public virtual DbSet<Consignment> Consignments { get; set; }
public virtual DbSet<Order> Orders { get; set; }
public virtual DbSet<Request> Requests { get; set; }
public virtual DbSet<Seller> Sellers { get; set; }
}
}