ключи для исполнителя

This commit is contained in:
Софья Якобчук 2024-05-01 14:26:04 +04:00
parent dda1172394
commit 06c1f429eb
2 changed files with 10 additions and 2 deletions

View File

@ -11,8 +11,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\LawCompanyDataModels\LawCompanyDataModels.csproj" />
<ProjectReference Include="..\LawCompanyContracts\LawCompanyContracts.csproj" /> <ProjectReference Include="..\LawCompanyContracts\LawCompanyContracts.csproj" />
<ProjectReference Include="..\LawCompany\LawCompanyDataModels.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -2,6 +2,7 @@
using LawCompanyContracts.BindingModels; using LawCompanyContracts.BindingModels;
using LawCompanyContracts.ViewModels; using LawCompanyContracts.ViewModels;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace LawCompanyDatabaseImplement.Models namespace LawCompanyDatabaseImplement.Models
{ {
@ -15,6 +16,13 @@ namespace LawCompanyDatabaseImplement.Models
[Required] [Required]
public string Password { get; private set; } = string.Empty; public string Password { get; private set; } = string.Empty;
[ForeignKey("ExecutorId")]
public virtual List<Case> Cases { get; set; } = new();
[ForeignKey("ExecutorId")]
public virtual List<Client> Clients { get; set; } = new();
[ForeignKey("ExecutorId")]
public virtual List<Visit> Visits { get; set; } = new();
public static Executor? Create(ExecutorBindingModel? model) public static Executor? Create(ExecutorBindingModel? model)
{ {
if (model == null) if (model == null)