Пример #1
0
        public async Task <IActionResult> GetSpecificationsForFundingByPeriod(string fundingPeriodId)
        {
            Guard.IsNullOrWhiteSpace(fundingPeriodId, nameof(fundingPeriodId));

            ApiResponse <IEnumerable <SpecificationSummary> > apiResponse = await _specsClient.GetSpecificationsSelectedForFundingByPeriod(fundingPeriodId);

            if (apiResponse.StatusCode == HttpStatusCode.OK)
            {
                return(Ok(apiResponse.Content.OrderBy(c => c.Name)));
            }

            if (apiResponse.StatusCode == HttpStatusCode.BadRequest)
            {
                return(new BadRequestResult());
            }

            return(new StatusCodeResult(500));
        }