public async Task <IActionResult> All()
        {
            List <RoomTypeAllViewModel> roomTypes = await roomTypeService.GetAllRoomTypes()
                                                    .To <RoomTypeAllViewModel>()
                                                    .ToListAsync();

            return(View(roomTypes));
        }
示例#2
0
        //TODO if time remains to make it better not ViewData
        private async Task GetAllRoomTypes()
        {
            var allRoomTypes = await roomTypeService.GetAllRoomTypes().ToListAsync();

            ViewData["roomTypes"] = allRoomTypes.Select(roomType => new RoomCreateRoomTypeViewModel
            {
                RoomTypeName = roomType.Name
            })
                                    .ToList();
        }
示例#3
0
        public IActionResult Index()
        {
            List <RoomType> roomTypes = _roomTypeService.GetAllRoomTypes();

            return(View(roomTypes));
        }
        public async Task <IActionResult> RoomTypeList()
        {
            var response = await _roomTypeService.GetAllRoomTypes();

            return(Ok(response));
        }
示例#5
0
 public void GetAllRoomTypeTest()
 {
     Assert.NotNull(_roomTypeService.GetAllRoomTypes());
 }
示例#6
0
 public async Task OnGetAsync()
 {
     this.RoomType = await _roomTypeService.GetAllRoomTypes();
 }
示例#7
0
        public async Task <IActionResult> GetRoomTypes()
        {
            var roomTypes = await _roomTypeService.GetAllRoomTypes();

            return(Ok(roomTypes));
        }