PIbd-21_KozyrevSS_SewingDre.../SewingDresses/SewingDressesDatabaseImplement/SewingDressesDatabase.cs

21 lines
880 B
C#
Raw Normal View History

2024-03-08 14:55:42 +04:00
using SewingDressesDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
namespace SewingDressesDatabaseImplement
{
public class SewingDressesDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"Data Source=.\SQLEXPRESS;Initial Catalog=SewingDressesDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Component> Components { get; set; }
public virtual DbSet<Dress> Dresses { get; set; }
public virtual DbSet<DressComponent> DressComponents { get; set; }
public virtual DbSet<Order> Orders { get; set; }
}
}