using HospitalDataModels.Models; using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Text.Json.Serialization; using System.Threading.Tasks; namespace HospitalContracts.ViewModels { public class RecipesViewModel: IRecipesModel { public int Id { get; set; } public int ClientId { get; set; } [DisplayName("Доза")] public string Dose { get; set; } = string.Empty; [DisplayName("Дата выписки")] public DateTime Date { get; set; } [DisplayName("Клиент")] public string ClientFIO { get; set; } = string.Empty; [DisplayName("Способ приготовления")] public string ModeOfApplication { get; set; } = string.Empty; [DisplayName("Процедура")] public Dictionary RecipeProcedures { get; set; } = new(); [DisplayName("Симптом")] public int SymptomsId { get; set; } public RecipesViewModel() { } [JsonConstructor] public RecipesViewModel(Dictionary RecipeProcedures) { this.RecipeProcedures = RecipeProcedures.ToDictionary(x => x.Key, x => x.Value as IProceduresModel); } } }