public async Task <Catalog> GetCatalogItems(int page, int take, int?brand, int?type, IEnumerable <string> tags) { var allcatalogItemsUri = CatalogAI.GetAllCatalogItems(_remoteServiceBaseUrl, page, take, brand, type, tags); var dataString = await _apiClient.GetStringAsync(allcatalogItemsUri); var response = string.IsNullOrEmpty(dataString) ? Catalog.Empty : JsonConvert.DeserializeObject <Catalog>(dataString); return(response); }
public async Task <IEnumerable <CatalogItem> > GetRecommendationsAsync(string productId, IEnumerable <string> productIDs) { var recommendationsUri = CatalogAI.GetProducSetDetailsByIDs(_remoteServiceBaseUrl, productId, productIDs); var dataString = await _apiClient.GetStringAsync(recommendationsUri); var response = String.IsNullOrEmpty(dataString) ? Enumerable.Empty <CatalogItem>() : JsonConvert.DeserializeObject <List <CatalogItem> >(dataString); return(response); }