PIbd-22_Fedorenko_Puchkina_.../LawFim/LawFirmContracts/ViewModels/VisitViewModel.cs

23 lines
710 B
C#

using LawFimDataModels.Models;
using System.ComponentModel;
using Newtonsoft.Json;
namespace LawFirmContracts.ViewModels
{
public class VisitViewModel : IVisitModel
{
public int Id { get; set; }
[DisplayName("Дата визита")]
public DateTime VisitDate { get; set; }
public int HearingId { get; set; }
public Dictionary<int, IClientModel> VisitClients { get; set; } = new();
public int ExecutorId { get; set; }
public VisitViewModel() { }
[JsonConstructor]
public VisitViewModel(Dictionary<int, ClientViewModel> VisitClients)
{
this.VisitClients = VisitClients.ToDictionary(x => x.Key, x => x.Value as IClientModel);
}
}
}