From ce0e36bb822901efe000430b3dee121600cc7e25 Mon Sep 17 00:00:00 2001 From: dsanz Date: Fri, 3 Mar 2017 11:10:39 +0100 Subject: [PATCH] Fix wrong calculation of items per page in catalog controller (last page was showing always 10) --- .../WebMonolithic/eShopWeb/Controllers/CatalogController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Web/WebMonolithic/eShopWeb/Controllers/CatalogController.cs b/src/Web/WebMonolithic/eShopWeb/Controllers/CatalogController.cs index a4e891f0c..ca95400a4 100644 --- a/src/Web/WebMonolithic/eShopWeb/Controllers/CatalogController.cs +++ b/src/Web/WebMonolithic/eShopWeb/Controllers/CatalogController.cs @@ -26,7 +26,7 @@ namespace Microsoft.eShopWeb.Controllers public async Task Index(int? BrandFilterApplied, int? TypesFilterApplied, int? page) { var itemsPage = 10; - var catalog = await _catalogSvc.GetCatalogItems(page ?? 0, itemsPage, BrandFilterApplied, TypesFilterApplied); + var catalog = await _catalogSvc.GetCatalogItems(page ?? 0, itemsPage, BrandFilterApplied, TypesFilterApplied); var vm = new CatalogIndex() { @@ -38,7 +38,7 @@ namespace Microsoft.eShopWeb.Controllers PaginationInfo = new PaginationInfo() { ActualPage = page ?? 0, - ItemsPerPage = (catalog.Count < itemsPage) ? catalog.Count : itemsPage, + ItemsPerPage = catalog.Data.Count, TotalItems = catalog.Count, TotalPages = int.Parse(Math.Ceiling(((decimal)catalog.Count / itemsPage)).ToString()) }