ISEbd-21_Agliullov.D.A._Con.../ConfectioneryDatabaseImplement/ConfectioneryDatabase.cs

28 lines
1020 B
C#
Raw Normal View History

using ConfectioneryDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
using System.Diagnostics.Metrics;
namespace ConfectioneryDatabaseImplement
{
public class ConfectioneryDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
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; }
}
}