Compare commits

...

3 Commits

4 changed files with 11 additions and 0 deletions

View File

@ -10,5 +10,6 @@ namespace LawFimDataModels.Models
string CaseType { get; }
DateTime DateCreate { get; }
DateTime? DateImplement { get; }
public int ExecutorId { get; }
}
}

View File

@ -5,5 +5,6 @@
string FIO { get; }
string Phone { get; }
string Email { get; }
public int ExecutorId { get; }
}
}

View File

@ -5,5 +5,6 @@
Dictionary<int, IClientModel> VisitClients { get; }
DateTime VisitDate { get; }
int HearingId { get; }
public int ExecutorId { get; }
}
}

View File

@ -2,6 +2,7 @@
using LawFirmContracts.BindingModels;
using LawFirmContracts.ViewModels;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace LawFirmDatabaseImplement.Models
{
@ -15,6 +16,13 @@ namespace LawFirmDatabaseImplement.Models
[Required]
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)
{
if (model == null)