2024-04-23 21:50:08 +04:00
|
|
|
|
using LawFirmContracts.BindingModels;
|
|
|
|
|
using LawFirmDatabaseImplement.Models;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
2024-04-23 19:29:48 +04:00
|
|
|
|
|
|
|
|
|
namespace LawFirmDatabaseImplement
|
|
|
|
|
{
|
2024-04-23 21:50:08 +04:00
|
|
|
|
public class LawFirmDatabase : DbContext
|
2024-04-23 19:29:48 +04:00
|
|
|
|
{
|
2024-04-23 21:50:08 +04:00
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder
|
|
|
|
|
optionsBuilder)
|
|
|
|
|
{
|
|
|
|
|
if (optionsBuilder.IsConfigured == false)
|
|
|
|
|
{
|
2024-04-28 01:40:12 +04:00
|
|
|
|
optionsBuilder.UseSqlServer(@"Data Source=ZIRAEL\SQLEXPRESS;Initial Catalog=LawFirmDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
2024-04-28 00:38:30 +04:00
|
|
|
|
|
2024-04-28 01:40:12 +04:00
|
|
|
|
//optionsBuilder.UseSqlServer(@"Data Source=PC-Anna\SQLEXPRESS;Initial Catalog=LawFirmDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
2024-04-27 22:16:36 +04:00
|
|
|
|
}
|
2024-04-23 21:50:08 +04:00
|
|
|
|
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; }
|
2024-04-23 19:29:48 +04:00
|
|
|
|
}
|
|
|
|
|
}
|