aleksandr chegodaev 38f0e3fcd5 lab3
2024-04-13 02:17:11 +04:00

30 lines
1006 B
C#

using LawFirmDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LawFirmDatabaseImplement
{
public class LawFirmDataBase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder
optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"Data Source=YACUTE\SQLEXPRESS;Initial Catalog=LawFirmDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Models.Component> Components { set; get; }
public virtual DbSet<Law> Laws { set; get; }
public virtual DbSet<LawComponent> LawComponents { set; get; }
public virtual DbSet<Order> Orders { set; get; }
}
}