2023-02-19 22:48:53 +04:00
|
|
|
|
using ConfectioneryDatabaseImplement.Models;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using System.Diagnostics.Metrics;
|
|
|
|
|
|
|
|
|
|
namespace ConfectioneryDatabaseImplement
|
|
|
|
|
{
|
|
|
|
|
public class ConfectioneryDatabase : DbContext
|
|
|
|
|
{
|
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
|
|
|
{
|
2023-02-20 01:35:50 +04:00
|
|
|
|
// Перед работой необходимо установить SQL Express
|
2023-02-19 22:48:53 +04:00
|
|
|
|
if (optionsBuilder.IsConfigured == false)
|
|
|
|
|
{
|
|
|
|
|
optionsBuilder.UseSqlServer(@"
|
|
|
|
|
Server = localhost\SQLEXPRESS;
|
|
|
|
|
Initial Catalog = ConfectioneryDatabaseFull;
|
|
|
|
|
Integrated Security = True;
|
|
|
|
|
MultipleActiveResultSets = True;
|
|
|
|
|
TrustServerCertificate = True");
|
|
|
|
|
}
|
|
|
|
|
base.OnConfiguring(optionsBuilder);
|
|
|
|
|
}
|
|
|
|
|
public virtual DbSet<Component> Components { set; get; }
|
|
|
|
|
public virtual DbSet<Pastry> Pastries { set; get; }
|
|
|
|
|
public virtual DbSet<PastryComponent> PastryComponents { set; get; }
|
|
|
|
|
public virtual DbSet<Order> Orders { set; get; }
|
2023-03-04 14:39:23 +04:00
|
|
|
|
public virtual DbSet<Client> Clients { set; get; }
|
2023-03-06 14:08:25 +04:00
|
|
|
|
public virtual DbSet<Implementer> Implementers { set; get; }
|
2023-02-19 22:48:53 +04:00
|
|
|
|
}
|
|
|
|
|
}
|