CourseWork_Hotel/Hotel/HotelContracts/ViewModels/MealPlanViewModel.cs

31 lines
950 B
C#
Raw Normal View History

2023-04-01 19:20:54 +04:00
using HotelDataModels.Models;
using System.ComponentModel;
using Newtonsoft.Json;
2023-04-01 19:20:54 +04:00
namespace HotelContracts.ViewModels
{
public class MealPlanViewModel : IMealPlanModel
{
[DisplayName("Название плана питания")]
public string MealPlanName { get; set; } = string.Empty;
[DisplayName("Цена плана питания")]
public double MealPlanPrice { get; set; }
public int OrganiserId { get; set; }
public int Id { get; set; }
public Dictionary<int, IMemberModel> MealPlanMembers { get; set; } = new();
2023-04-07 13:49:59 +04:00
public Dictionary<int, IRoomModel> MealPlanRooms { get; set; }
public MealPlanViewModel() { }
[JsonConstructor]
public MealPlanViewModel(Dictionary<int, MemberViewModel> MealPlanMembers)
{
this.MealPlanMembers = MealPlanMembers.ToDictionary(x => x.Key, x => x.Value as IMemberModel);
}
2023-04-01 19:20:54 +04:00
}
}