а кто такие фиксики большой большой секрет

This commit is contained in:
sofiaivv 2024-05-01 17:43:44 +04:00
parent b3c8617f66
commit 10dd71a9c7
5 changed files with 16 additions and 8 deletions

View File

@ -5,11 +5,11 @@ VisualStudioVersion = 17.9.34723.18
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LawCompanyDataModels", "LawCompany\LawCompanyDataModels.csproj", "{E38D3745-25B2-45EC-B47E-14C6100C9413}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LawCompanyDataModels", "LawCompany\LawCompanyDataModels.csproj", "{E38D3745-25B2-45EC-B47E-14C6100C9413}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LawCompanyContracts", "LawCompanyContracts\LawCompanyContracts.csproj", "{DD8E5EB4-CA20-4C49-9DBF-F9778202331B}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LawCompanyContracts", "LawCompanyContracts\LawCompanyContracts.csproj", "{DD8E5EB4-CA20-4C49-9DBF-F9778202331B}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LawCompanyBusinessLogic", "LawCompanyBusinessLogic\LawCompanyBusinessLogic.csproj", "{14D20CC6-D50F-4674-AC2A-4F80C85EDB4D}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LawCompanyBusinessLogic", "LawCompanyBusinessLogic\LawCompanyBusinessLogic.csproj", "{14D20CC6-D50F-4674-AC2A-4F80C85EDB4D}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LawCompanyDatabaseImplement", "LawCompanyDatabaseImplement\LawCompanyDatabaseImplement.csproj", "{9A4CBD1F-020F-4036-A71D-AB6BF3489EE0}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LawCompanyDatabaseImplement", "LawCompanyDatabaseImplement\LawCompanyDatabaseImplement.csproj", "{9A4CBD1F-020F-4036-A71D-AB6BF3489EE0}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@ -20,6 +20,8 @@ namespace LawCompanyDatabaseImplement.Models
public int GuarantorId { get; set; } public int GuarantorId { get; set; }
private Dictionary<int, ILawyerModel>? _consultationLawyers = null; private Dictionary<int, ILawyerModel>? _consultationLawyers = null;
[ForeignKey("ConsultationId")]
public virtual List<ConsultationLawyer> Lawyers { get; set; } = new();
[NotMapped] [NotMapped]
public Dictionary<int, ILawyerModel> ConsultationLawyers public Dictionary<int, ILawyerModel> ConsultationLawyers
{ {
@ -35,8 +37,6 @@ namespace LawCompanyDatabaseImplement.Models
return _consultationLawyers; return _consultationLawyers;
} }
} }
[ForeignKey("ConsultationId")]
public virtual List<ConsultationLawyer> Lawyers { get; set; } = new();
public static Consultation? Create(LawCompanyDatabase context, ConsultationBindingModel? model) public static Consultation? Create(LawCompanyDatabase context, ConsultationBindingModel? model)
{ {
if (model == null) if (model == null)

View File

@ -1,7 +1,9 @@
using LawCompanyContracts.BindingModels; using LawCompanyContracts.BindingModels;
using LawCompanyContracts.ViewModels; using LawCompanyContracts.ViewModels;
using LawCompanyDatabaseImplement.Models;
using LawCompanyDataModels.Models; using LawCompanyDataModels.Models;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace LawFirmDatabaseImplement.Models namespace LawFirmDatabaseImplement.Models
{ {
@ -14,6 +16,12 @@ namespace LawFirmDatabaseImplement.Models
public string Email { get; private set; } = string.Empty; public string Email { get; private set; } = string.Empty;
[Required] [Required]
public string Password { get; private set; } = string.Empty; public string Password { get; private set; } = string.Empty;
[ForeignKey("GuarantorId")]
public virtual List<Hearing> Hearings { get; set; } = new();
[ForeignKey("GuarantorId")]
public virtual List<Lawyer> Lawyers { get; set; } = new();
[ForeignKey("GuarantorId")]
public virtual List<Consultation> Consultations { get; set; } = new();
public static Guarantor? Create(GuarantorBindingModel? model) public static Guarantor? Create(GuarantorBindingModel? model)
{ {

View File

@ -17,6 +17,8 @@ namespace LawCompanyDatabaseImplement.Models
public string Judge { get; private set; } = string.Empty; public string Judge { get; private set; } = string.Empty;
public int GuarantorId { get; set; } public int GuarantorId { get; set; }
private Dictionary<int, ILawyerModel>? _hearingLawyers = null; private Dictionary<int, ILawyerModel>? _hearingLawyers = null;
[ForeignKey("HearingId")]
public virtual List<HearingLawyer> Lawyers { get; set; } = new();
[NotMapped] [NotMapped]
public Dictionary<int, ILawyerModel> HearingLawyers public Dictionary<int, ILawyerModel> HearingLawyers
{ {
@ -32,8 +34,6 @@ namespace LawCompanyDatabaseImplement.Models
return _hearingLawyers; return _hearingLawyers;
} }
} }
[ForeignKey("HearingId")]
public virtual List<HearingLawyer> Lawyers { get; set; } = new();
public static Hearing? Create(LawCompanyDatabase context, HearingBindingModel? model) public static Hearing? Create(LawCompanyDatabase context, HearingBindingModel? model)
{ {
if (model == null) if (model == null)

View File

@ -20,7 +20,7 @@ namespace LawFirmDatabaseImplement.Models
[ForeignKey("LawyerId")] [ForeignKey("LawyerId")]
public virtual List<HearingLawyer> HearingLawyers { get; set; } = new(); public virtual List<HearingLawyer> HearingLawyers { get; set; } = new();
[ForeignKey("LawyerId")] [ForeignKey("LawyerId")]
public virtual List<ConsultationLawyer> LawyerConsultations { get; set; } = new(); public virtual List<ConsultationLawyer> ConsultationLawyers { get; set; } = new();
public int GuarantorId { get; set; } public int GuarantorId { get; set; }
public static Lawyer? Create(LawyerBindingModel? model) public static Lawyer? Create(LawyerBindingModel? model)