Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        //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);
        }
Exemplo n.º 3
0
        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);
        }