public async Task <IEnumerable <Resource> > Get() { HttpResponseMessage ResponseFromRepo = await RestOps.GetResponseAsync(Constants.RepoURL); if (!ResponseFromRepo.IsSuccessStatusCode) { throw new Exception("Exception while request to repo. Status Code : " + ResponseFromRepo.StatusCode); } Resources SearchResultSetInListOfResources = await ResponseFromRepo.Content.ReadAsAsync <Resources>(); return(SearchResultSetInListOfResources.Data); }
//https://???/v3/registration/helloworld.pmml/index.json public async Task <ResourceInfo> Get(string ResourceId) { HttpResponseMessage ResponseFromRepo = await RestOps.GetResponseAsync(Constants.RepoURLByResourceId.Replace("ResourceId", ResourceId)); if (!ResponseFromRepo.IsSuccessStatusCode) { throw new Exception("Exception while request to repo. Status Code : " + ResponseFromRepo.StatusCode); } ResourceInfo SearchResultSetInListOfResources = await ResponseFromRepo.Content.ReadAsAsync <ResourceInfo>(); return(SearchResultSetInListOfResources); }
private async Task <IEnumerable <Resource> > GetResourcesByTypeAndQueryString(string ResourceType, string QueryString) { HttpResponseMessage ResponseFromRepo = await RestOps.GetResponseAsync(Constants.RepoURLQueryByResourceTypeAndQueryString.Replace("ResourceType", ResourceType).Replace("QueryString", QueryString)); if (!ResponseFromRepo.IsSuccessStatusCode) { throw new Exception("Exception while request to repo. Status Code : " + ResponseFromRepo.StatusCode); } Resources SearchResultSetInListOfResources = await ResponseFromRepo.Content.ReadAsAsync <Resources>(); return(SearchResultSetInListOfResources.Data); }