2024-04-29 00:44:49 +04:00
|
|
|
|
using ElectronicsShopDataBaseImplement.Models;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
2024-04-28 23:08:09 +04:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace ElectronicsShopDataBaseImplement
|
|
|
|
|
{
|
2024-04-29 00:44:49 +04:00
|
|
|
|
public class Database : DbContext
|
2024-04-28 23:08:09 +04:00
|
|
|
|
{
|
2024-05-28 11:42:47 +04:00
|
|
|
|
//DESKTOP-E2VPEN3
|
|
|
|
|
//DESKTOP-O0N00SH
|
2024-04-29 00:44:49 +04:00
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder
|
|
|
|
|
optionsBuilder)
|
2024-04-28 23:08:09 +04:00
|
|
|
|
{
|
2024-05-25 17:47:14 +04:00
|
|
|
|
if (optionsBuilder.IsConfigured == false) {
|
2024-05-28 11:42:47 +04:00
|
|
|
|
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-E2VPEN3\SQLEXPRESS;Initial Catalog=ElectronicsShopDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
2024-05-25 17:47:14 +04:00
|
|
|
|
}
|
|
|
|
|
base.OnConfiguring(optionsBuilder);
|
|
|
|
|
}
|
2024-05-25 13:06:38 +04:00
|
|
|
|
public virtual DbSet<Client> Clients { set; get; }
|
2024-04-29 01:55:20 +04:00
|
|
|
|
public virtual DbSet<Product> Products { set; get; }
|
|
|
|
|
public virtual DbSet<Order> Orders { set; get; }
|
2024-05-25 13:06:38 +04:00
|
|
|
|
public virtual DbSet<OrderProduct> OrderProducts { set; get; }
|
|
|
|
|
public virtual DbSet<Employee> Employees { set; get; }
|
|
|
|
|
public virtual DbSet<CostItem> CostItems { set; get; }
|
2024-05-26 18:12:25 +04:00
|
|
|
|
public virtual DbSet<Paymeant> Paymeants { get; set; }
|
2024-04-28 23:08:09 +04:00
|
|
|
|
}
|
|
|
|
|
}
|