public async Task <ActionResult> Create() { var roomTypes = await _roomTypeRepository.GetAllAsync(); var emptyRoomViewModel = new RoomViewModel { RoomTypes = new SelectList(roomTypes, "Id", "Name", roomTypes.First()) }; return(View(emptyRoomViewModel)); }
public async Task GetAllAsyncTest() { var roomTypes = await _repository.GetAllAsync(); Assert.True(roomTypes.Any()); }
public async Task <ActionResult> Index() => View((await _repository.GetAllAsync()).OrderBy(t => t.Name).Select(RoomTypeViewModel.FromRoomType));