Rogashova_E.A._CourseWork_H.../HospitalContracts/ViewModels/KurseViewModel.cs

33 lines
978 B
C#
Raw Permalink Normal View History

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 KurseViewModel: IKurseModel
{
public int Id { get; set; }
[DisplayName("Продолжительность курса")]
public string Duration { get; set; } = string.Empty;
[DisplayName("Срок приема")]
public int CountInDay { get; set; }
public Dictionary<int, IMedicinesModel> KurseMedicines
{
get;
set;
} = new();
public KurseViewModel() { }
[JsonConstructor]
public KurseViewModel(Dictionary<int, MedicinesViewModel> KurseMedicines)
{
this.KurseMedicines = KurseMedicines.ToDictionary(x => x.Key, x => x.Value as IMedicinesModel);
}
}
}