From 06c1f429eb94e1cd37f99138ca71a060bfad7a6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BE=D1=84=D1=8C=D1=8F=20=D0=AF=D0=BA=D0=BE=D0=B1?= =?UTF-8?q?=D1=87=D1=83=D0=BA?= Date: Wed, 1 May 2024 14:26:04 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BA=D0=BB=D1=8E=D1=87=D0=B8=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D0=BD=D0=B8=D1=82=D0=B5?= =?UTF-8?q?=D0=BB=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LawCompanyBusinessLogic.csproj | 4 ++-- LawCompany/LawCompanyDatabaseImplement/Models/Executor.cs | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/LawCompany/LawCompanyBusinessLogic/LawCompanyBusinessLogic.csproj b/LawCompany/LawCompanyBusinessLogic/LawCompanyBusinessLogic.csproj index 7cd0327..6aa3279 100644 --- a/LawCompany/LawCompanyBusinessLogic/LawCompanyBusinessLogic.csproj +++ b/LawCompany/LawCompanyBusinessLogic/LawCompanyBusinessLogic.csproj @@ -10,9 +10,9 @@ - - + + diff --git a/LawCompany/LawCompanyDatabaseImplement/Models/Executor.cs b/LawCompany/LawCompanyDatabaseImplement/Models/Executor.cs index 4e57f07..e065d93 100644 --- a/LawCompany/LawCompanyDatabaseImplement/Models/Executor.cs +++ b/LawCompany/LawCompanyDatabaseImplement/Models/Executor.cs @@ -2,6 +2,7 @@ using LawCompanyContracts.BindingModels; using LawCompanyContracts.ViewModels; using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; namespace LawCompanyDatabaseImplement.Models { @@ -15,6 +16,13 @@ namespace LawCompanyDatabaseImplement.Models [Required] public string Password { get; private set; } = string.Empty; + [ForeignKey("ExecutorId")] + public virtual List Cases { get; set; } = new(); + [ForeignKey("ExecutorId")] + public virtual List Clients { get; set; } = new(); + [ForeignKey("ExecutorId")] + public virtual List Visits { get; set; } = new(); + public static Executor? Create(ExecutorBindingModel? model) { if (model == null)