35 lines
978 B
C#
Raw Normal View History

using HotelDataModels.Models;
using Newtonsoft.Json;
using System.ComponentModel;
namespace HotelContracts.ViewModels
{
public class RoomViewModel : IRoomModel
{
public int Id { get; set; }
[DisplayName("Название комнаты")]
public string RoomName { get; set; } = string.Empty;
[DisplayName("Корпус комнаты")]
public string RoomFrame { get; set; } = string.Empty;
[DisplayName("Стоимость комнаты")]
public double RoomPrice { get; set; }
2024-03-30 22:21:51 +04:00
public int? MealPlanId { get; set; }
public int HeadwaiterId { get; set; }
public Dictionary<int, ILunchModel> RoomLunches { get; set; }
public RoomViewModel() { }
[JsonConstructor]
2024-03-23 18:47:45 +04:00
public RoomViewModel(Dictionary<int, LunchViewModel> RoomLunches)
{
2024-03-23 18:47:45 +04:00
this.RoomLunches = RoomLunches.ToDictionary(x => x.Key, x => x.Value as ILunchModel);
}
}
}