PIbd-23-Lisov-N.A-SewingDre.../DressAtelierDatabaseImplement/DressAtelierDatabase.cs

28 lines
1.0 KiB
C#
Raw Permalink Normal View History

2023-03-12 16:07:01 +04:00
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)
{
2023-03-12 23:37:40 +04:00
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-7QJ9UJE\SQLEXPRESS;Initial Catalog=DressAtelierDatabaseFull;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
2023-03-12 16:07:01 +04:00
}
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; }
}
}