PIbd-23-Lisov-N.A-SewingDre.../DressAtelierDatabaseImplement/DressAtelierDatabase.cs
2023-03-23 18:32:47 +04:00

28 lines
1.0 KiB
C#

using DressAtelierDatabaseImplementation.Models;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DressAtelierDatabaseImplementation
{
public class DressAtelierDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-7QJ9UJE\SQLEXPRESS;Initial Catalog=DressAtelierDatabaseFull;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Material> Materials { set; get; }
public virtual DbSet<Dress> Dresses { set; get; }
public virtual DbSet<DressMaterial> DressMaterials { set; get; }
public virtual DbSet<Order> Orders { set; get; }
}
}