Example #1
0
        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));
        }
Example #2
0
        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);
        }
Example #3
0
 public async Task <GetLoadtestsForTimePeriodResponse> GetLoadtestsForTimePeriodAsync(GetLoadtestsForTimePeriodRequest getLoadtestsForTimePeriodRequest)
 {
     return(await Task <GetLoadtestsForTimePeriodResponse> .Run(() => GetLoadtestsForTimePeriod(getLoadtestsForTimePeriodRequest)));
 }
Example #4
0
 public async Task <GetLoadtestsForTimePeriodResponse> GetLoadtestsForTimePeriodAsync(GetLoadtestsForTimePeriodRequest getLoadtestsForTimePeriodRequest)
 {
     return(await _innerTimetableService.GetLoadtestsForTimePeriodAsync(getLoadtestsForTimePeriodRequest));
 }