PIbd23_Ivanova_Yakobchuk_Co.../LawCompany/LawCompanyDatabaseImplement/LawCompanyDatabase.cs

37 lines
1.6 KiB
C#

using LawCompanyContracts.BindingModels;
using LawCompanyDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LawCompanyDatabaseImplement
{
public class LawCompanyDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder
optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
//optionsBuilder.UseSqlServer(@"Data Source=LAPTOP-6GNIALH9\SQLEXPRESS;Initial Catalog=LawCompanyDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-7DB3VEN\SQLEXPRESS;Initial Catalog=Test;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Case> Cases { set; get; }
public virtual DbSet<CaseClient> CaseClients { set; get; }
public virtual DbSet<Client> Clients { set; get; }
public virtual DbSet<Hearing> Hearings { set; get; }
public virtual DbSet<HearingLawyer> HearingLawyers { set; get; }
public virtual DbSet<Lawyer> Lawyers { set; get; }
public virtual DbSet<Visit> Visits { set; get; }
public virtual DbSet<VisitClient> VisitClients { set; get; }
public virtual DbSet<Consultation> Consultations { set; get; }
public virtual DbSet<ConsultationLawyer> ConsultationLawyers { set; get; }
public virtual DbSet<Guarantor> Guarantors { set; get; }
public virtual DbSet<Executor> Executors { set; get; }
}
}