public async Task <HotelReservationModel> Search(SearchModel searchRequest, CancellationToken cancellationToken) { HotelReservationModel hotelReservation = new HotelReservationModel() { NumberOfDays = (int)Math.Ceiling(searchRequest.EndDate.Subtract(searchRequest.StartDate).TotalDays) }; hotelReservation.Hotels = await _hotelDataProvider.FindHotels(searchRequest.StartLocation, searchRequest.StartDate, cancellationToken); if (searchRequest.IsTest) { hotelReservation.SelectedHotel = hotelReservation.Hotels.Skip(TestSettings.random.Next(hotelReservation.Hotels.Count() - 1)).First().Id; } return(hotelReservation); }
public async Task <IEnumerable <HotelModel> > FindHotels(string location, DateTimeOffset desiredTime, CancellationToken cancellationToken) { return(await _hotelDataProvider.FindHotels(location, desiredTime, cancellationToken)); }