Pibd-22_Presnyakova.V.V_Jew.../JewelryStoreDatabaseImplement/JewelryStoreDataBase.cs

33 lines
1.1 KiB
C#
Raw Normal View History

2023-03-05 19:31:05 +04:00
using Microsoft.EntityFrameworkCore;
using System;
2023-03-05 18:39:34 +04:00
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
2023-03-05 19:31:05 +04:00
using JewelryStoreDatabaseImplement.Models;
2023-03-05 18:39:34 +04:00
namespace JewelryStoreDatabaseImplement
{
2023-03-05 19:31:05 +04:00
public class JewelryStoreDataBase : DbContext
2023-03-05 18:39:34 +04:00
{
2023-03-05 19:31:05 +04:00
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-H890EHR\SQLEXPRESS;Initial Catalog=JewelryStoreDatabaseFull;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Component> Components { set; get; }
public virtual DbSet<Jewel> Jewels { set; get; }
public virtual DbSet<JewelComponent> JewelComponents { set; get; }
public virtual DbSet<Order> Orders { set; get; }
public virtual DbSet<Client> Clients { set; get; }
2023-04-01 20:39:14 +04:00
2023-03-05 18:39:34 +04:00
}
2023-04-01 20:39:14 +04:00
}
2023-03-05 19:31:05 +04:00