コード例 #1
0
        public async Task<CatalogProduct> GetProductByNameAsync(string productName)
        {
            string requestUri = String.Format("Products/ByName?name={0}", productName);

            var responseFetcher = new ResponseFetcher<CatalogProduct>(_ApiServiceUrl, _ApiAppKey);

            return await responseFetcher.GetResponseAsync(requestUri).ConfigureAwait(false);
        }
コード例 #2
0
        public async Task<List<CatalogProduct>> GetAllChildProductsAsync(string topLevelCategoryId)
        {
            string requestUri = String.Format("Products/ByTopLevelCategory?id={0}", topLevelCategoryId);

            var responseFetcher = new ResponseFetcher<List<CatalogProduct>>(_ApiServiceUrl, _ApiAppKey);

            return await responseFetcher.GetResponseAsync(requestUri).ConfigureAwait(false);
        }
コード例 #3
0
        public async Task<CatalogCategory> GetCategoryAsync(string categoryId)
        {
            string requestUri = String.Format("Categories?id={0}", categoryId);

            var responseFetcher = new ResponseFetcher<CatalogCategory>(_ApiServiceUrl, _ApiAppKey);

            return await responseFetcher.GetResponseAsync(requestUri).ConfigureAwait(false);
        }
コード例 #4
0
        public async Task<List<CatalogCategory>> GetCategoriesAsync(string parentCategoryId = null)
        {
            string requestUri = String.Format("Categories/SubCategories?parentCategoryId={0}", parentCategoryId);

            var responseFetcher = new ResponseFetcher<List<CatalogCategory>>(_ApiServiceUrl, _ApiAppKey);

            return await responseFetcher.GetResponseAsync(requestUri).ConfigureAwait(false);
        }
        public async Task<List<Product>> SearchAsync(string searchTerm)
        {
            string requestUri = String.Format("Search?q={0}", searchTerm);

            var responseFetcher = new ResponseFetcher<List<Product>>(_ApiServiceUrl, _ApiAppKey);

            return await responseFetcher.GetResponseAsync(requestUri).ConfigureAwait(false);
        }
        public async Task<Product> GetProductByIdAsync(string productId)
        {
            string requestUri = String.Format("Products?id={0}", productId);

            var responseFetcher = new ResponseFetcher<Product>(_ApiServiceUrl, _ApiAppKey);

            return await responseFetcher.GetResponseAsync(requestUri).ConfigureAwait(false);
        }