public async Task <PaginatedList <EpaoPipelineStandardsResponse> > Handle(EpaoPipelineStandardsRequest request, CancellationToken cancellationToken)
        {
            _logger.LogInformation("Retreiving Epao pipeline information");
            var result =
                await _standardRepository.GetEpaoPipelineStandards(request.EpaoId, request.OrderBy, request.OrderDirection, request.PageSize,
                                                                   request.PageIndex);

            var epaoPipelinStandardsResult = result.PageOfResults.Select(o =>
                                                                         new EpaoPipelineStandardsResponse
            {
                EstimatedDate = o.EstimateDate.UtcToTimeZoneTime().Date.ToString("MMMM yyyy"),
                Pipeline      = o.Pipeline,
                StandardName  = o.Title
            }).ToList();

            return(new PaginatedList <EpaoPipelineStandardsResponse>(epaoPipelinStandardsResult, result.TotalCount, request.PageIndex ?? 1, request.PageSize));
        }
Ejemplo n.º 2
0
        public async Task <PaginatedList <EpaoPipelineStandardsResponse> > Handle(EpaoPipelineStandardsRequest request, CancellationToken cancellationToken)
        {
            _logger.LogDebug($"GetEpaoPipelineStandardsHandler: EpaoId = {request.EpaoId}, OrderBy = {request.OrderBy}, OrderDirection = {request.OrderDirection}, PageSize = {request.PageSize}, PageIndex = {request.PageIndex}");

            var result =
                await _standardRepository.GetEpaoPipelineStandards(request.EpaoId, request.StandardFilterId, request.ProviderFilterId, request.EPADateFilterId,
                                                                   _config.PipelineCutoff, request.OrderBy, request.OrderDirection, request.PageSize, request.PageIndex);

            var epaoPipelinStandardsResult = result.PageOfResults.Select(o =>
                                                                         new EpaoPipelineStandardsResponse
            {
                EstimatedDate    = o.EstimateDate.UtcToTimeZoneTime().Date.ToString("MMMM yyyy"),
                Pipeline         = o.Pipeline,
                StandardName     = o.Title,
                StandardCode     = o.StdCode,
                StandardVersion  = o.Version,
                TrainingProvider = o.ProviderName,
                UKPRN            = o.UKPRN
            }).ToList();

            return(new PaginatedList <EpaoPipelineStandardsResponse>(epaoPipelinStandardsResult, result.TotalCount, request.PageIndex ?? 1, request.PageSize));
        }