PIbd-21_BatylkinaAO_MusoevD.../Canteen/CanteenContracts/ViewModels/OrderViewModel.cs

31 lines
1007 B
C#
Raw Permalink Normal View History

2023-04-06 14:34:58 +04:00
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;
2023-05-20 00:18:48 +04:00
using Newtonsoft.Json;
2023-04-06 14:34:58 +04:00
namespace CanteenContracts.View
{
public class OrderViewModel : IOrderModel
{
2023-04-07 21:53:52 +04:00
[DisplayName("ID посетителя")]
2023-04-07 18:58:07 +04:00
public int VisitorId { get; set; }
2023-04-07 21:53:52 +04:00
[DisplayName("Описание")]
2023-04-07 18:58:07 +04:00
public string Description { get; set; } = string.Empty;
2023-05-20 00:18:48 +04:00
public Dictionary<int, ICookModel> OrderCooks { get; set; }
public Dictionary<int, (ITablewareModel, int)> OrderTablewares { get; set; }
2023-04-07 23:35:33 +04:00
[DisplayName("ID заказа")]
2023-04-07 21:53:52 +04:00
public int Id { get; set; }
2023-05-20 00:18:48 +04:00
public OrderViewModel() { }
[JsonConstructor]
public OrderViewModel(Dictionary<int, CookViewModel> OrderCooks)
{
this.OrderCooks = OrderCooks.ToDictionary(x => x.Key, x => x.Value as ICookModel);
}
2023-04-06 14:34:58 +04:00
}
}