24 lines
732 B
C#
24 lines
732 B
C#
using HospitalDataModels.Models;
|
|
using Newtonsoft.Json;
|
|
using System.ComponentModel;
|
|
|
|
namespace HospitalContracts.ViewModels
|
|
{
|
|
public class TreatmentViewModel : ITreatmentModel
|
|
{
|
|
public int Id { get; set; }
|
|
[DisplayName("Название")]
|
|
public string Name { get; set; } = string.Empty;
|
|
|
|
public Dictionary<int, IProcedureModel> TreatmentProcedures { get; set; } = new();
|
|
|
|
public TreatmentViewModel() { }
|
|
|
|
[JsonConstructor]
|
|
public TreatmentViewModel(Dictionary<int, ProcedureViewModel> TreatmentProcedures)
|
|
{
|
|
this.TreatmentProcedures = TreatmentProcedures.ToDictionary(x => x.Key, x => x.Value as IProcedureModel);
|
|
}
|
|
}
|
|
}
|