Ejemplo n.º 1
0
        public ApprenticeshipDetails GetStandardProviderDetails(string standardCode, int ukprn, int location)
        {
            var model = _apprenticeshipProviderRepository.GetCourseByStandardCode(
                ukprn,
                location,
                standardCode);

            if (model != null)
            {
                return(model);
            }

            throw new HttpResponseException(HttpStatusCode.NotFound);
        }
        public ActionResult <ApprenticeshipDetails> GetStandardProviderDetails(string standardCode, [RequiredFromQuery] int ukprn, [RequiredFromQuery] int location)
        {
            var model = _apprenticeshipProviderRepository.GetCourseByStandardCode(
                ukprn,
                location,
                standardCode);

            if (model != null)
            {
                return(model);
            }

            return(NotFound());
        }
        private ApprenticeshipProviderDetailResponse GetStandard(ApprenticeshipProviderDetailQuery message)
        {
            var model = _apprenticeshipProviderRepository.GetCourseByStandardCode(
                message.UkPrn,
                message.LocationId,
                message.StandardCode);

            var apprenticeshipData = _getStandards.GetStandardById(message.StandardCode);

            var response = CreateResponse(model, apprenticeshipData, ApprenticeshipTrainingType.Standard);

            if (apprenticeshipData != null)
            {
                response.RegulatedApprenticeship = apprenticeshipData.RegulatedStandard;
            }

            return(response);
        }