Esempio n. 1
0
        public Provider Get(long ukprn)
        {
            var response = _getProviders.GetProviderByUkprn(ukprn);

            if (response == null)
            {
                throw HttpResponseFactory.RaiseException(
                          HttpStatusCode.NotFound,
                          $"No provider with Ukprn {ukprn} found");
            }

            response.Uri = Resolve(response.Ukprn);

            return(response);
        }
        public ActionResult <Provider> Get(long ukprn)
        {
            if (ukprn.ToString().Length != 8)
            {
                return(BadRequest(BadUkprnMessage));
            }

            var response = _getProviders.GetProviderByUkprn(ukprn);

            if (response == null)
            {
                return(NotFound($"No provider with Ukprn {ukprn} found"));
            }

            response.Uri = Resolve(response.Ukprn);

            return(response);
        }