Beispiel #1
0
		public async Task<Product[]> GetProductsInCategory(Category category)
		{
			var searchCriteria = new SearchCriteria
			{
				Operation = "ItemSearch",
				ResponseGroups = new[] { "ItemAttributes", "Images", "OfferSummary", "SalesRank", "Variations" },
				SearchIndex = category.SearchIndex,
				BrowseNode = category.NodeId,
				ItemPage = 1
			};

			var items = await _client.GetItems(searchCriteria);
			return items.Select(i => _factory.Create(i, searchCriteria)).ToArray();
		}
		public Task EnqueueCategory(Category category)
		{
			var message = _stringConverter.Convert(category);
			return _azureClient.AddMessageToQueue(_azureOptions.CategoriesQueueName, message);
		}
		public Task SaveCategory(Category category)
		{
			var entity = _entityConverter.Convert(category);
			return _repository.SaveCategory(entity);
		}