public async Task <IHttpActionResult> Get() { GetLoadtestsForTimePeriodRequest request = new GetLoadtestsForTimePeriodRequest(DateTime.UtcNow, DateTime.UtcNow.AddDays(14)); GetLoadtestsForTimePeriodResponse response = await _timetableService.GetLoadtestsForTimePeriodAsync(request); if (response.Exception == null) { return(Ok <IEnumerable <LoadTestViewModel> >(response.Loadtests)); } return(InternalServerError(response.Exception)); }
private GetLoadtestsForTimePeriodResponse GetLoadtestsForTimePeriod(GetLoadtestsForTimePeriodRequest getLoadtestsForTimePeriodRequest) { GetLoadtestsForTimePeriodResponse resp = new GetLoadtestsForTimePeriodResponse(); try { IList <Loadtest> loadtests = _timetableRepository.GetLoadtestsForTimePeriod(getLoadtestsForTimePeriodRequest.SearchStartDateUtc, getLoadtestsForTimePeriodRequest.SearchEndDateUtc); IEnumerable <LoadtestViewModel> ltVms = _timetableViewModelRepository.ConvertToViewModels(loadtests); resp.Loadtests = ltVms; } catch (Exception ex) { resp.Exception = ex; } return(resp); }
public async Task <GetLoadtestsForTimePeriodResponse> GetLoadtestsForTimePeriodAsync(GetLoadtestsForTimePeriodRequest getLoadtestsForTimePeriodRequest) { return(await Task <GetLoadtestsForTimePeriodResponse> .Run(() => GetLoadtestsForTimePeriod(getLoadtestsForTimePeriodRequest))); }
public async Task <GetLoadtestsForTimePeriodResponse> GetLoadtestsForTimePeriodAsync(GetLoadtestsForTimePeriodRequest getLoadtestsForTimePeriodRequest) { return(await _innerTimetableService.GetLoadtestsForTimePeriodAsync(getLoadtestsForTimePeriodRequest)); }