public List <AllergyData> GetAllergies(GetAllergiesRequest request) { try { List <AllergyData> result = null; IRestClient client = new JsonServiceClient(); //[Route("/{Context}/{Version}/{ContractNumber}/Allergy", "GET")] var url = Common.Helper.BuildURL(string.Format("{0}/{1}/{2}/{3}/Allergy", DDAllergyUrl, "NG", request.Version, request.ContractNumber), request.UserId); GetAllAllergysResponse dataDomainResponse = client.Get <GetAllAllergysResponse>(url); if (dataDomainResponse != null) { result = dataDomainResponse.Allergys; } return(result); } catch (WebServiceException ex) { throw new WebServiceException("AD:GetAllergies()::" + ex.Message, ex.InnerException); } }
//public AllergyService(IAllergyDataManager mgr) //{ // Manager = mgr; //} public GetAllAllergysResponse Get(GetAllAllergysRequest request) { var response = new GetAllAllergysResponse { Version = request.Version }; try { RequireUserId(request); response.Allergys = Manager.GetAllergyList(request); } catch (Exception ex) { RaiseException(response, ex); } return(response); }