public async Task <IActionResult> All() { List <RoomTypeAllViewModel> roomTypes = await roomTypeService.GetAllRoomTypes() .To <RoomTypeAllViewModel>() .ToListAsync(); return(View(roomTypes)); }
//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(); }
public IActionResult Index() { List <RoomType> roomTypes = _roomTypeService.GetAllRoomTypes(); return(View(roomTypes)); }
public async Task <IActionResult> RoomTypeList() { var response = await _roomTypeService.GetAllRoomTypes(); return(Ok(response)); }
public void GetAllRoomTypeTest() { Assert.NotNull(_roomTypeService.GetAllRoomTypes()); }
public async Task OnGetAsync() { this.RoomType = await _roomTypeService.GetAllRoomTypes(); }
public async Task <IActionResult> GetRoomTypes() { var roomTypes = await _roomTypeService.GetAllRoomTypes(); return(Ok(roomTypes)); }