Merge branch 'master' into Removing-unused-directives

This commit is contained in:
Hemant Kumar Dundigalla
2018-11-19 16:32:04 +00:00
10 changed files with 114 additions and 46 deletions

View File

@@ -42,14 +42,12 @@ namespace Microsoft.eShopWeb.Web.Services
_logger.LogInformation("GetCatalogItems called.");
var filterSpecification = new CatalogFilterSpecification(brandId, typeId);
var root = _itemRepository.List(filterSpecification);
var filterPaginatedSpecification =
new CatalogFilterPaginatedSpecification(itemsPage * pageIndex, itemsPage, brandId, typeId);
var totalItems = root.Count();
var itemsOnPage = root
.Skip(itemsPage * pageIndex)
.Take(itemsPage)
.ToList();
// the implementation below using ForEach and Count. We need a List.
var itemsOnPage = _itemRepository.List(filterPaginatedSpecification).ToList();
var totalItems = _itemRepository.Count(filterSpecification);
itemsOnPage.ForEach(x =>
{