using CanteenDataModels.Enums; using CanteenDataModels.Models; using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; using Newtonsoft.Json; namespace CanteenContracts.View { public class OrderViewModel : IOrderModel { [DisplayName("ID посетителя")] public int VisitorId { get; set; } [DisplayName("Описание")] public string Description { get; set; } = string.Empty; public Dictionary OrderCooks { get; set; } public Dictionary OrderTablewares { get; set; } [DisplayName("ID заказа")] public int Id { get; set; } public OrderViewModel() { } [JsonConstructor] public OrderViewModel(Dictionary OrderCooks) { this.OrderCooks = OrderCooks.ToDictionary(x => x.Key, x => x.Value as ICookModel); } } }