public IActionResult Order(int customerId, short?page = 1) { ViewData[GlobalViewBagKeys.ECommerceService] = eCommerce; OrderSearchModel searchModel = new OrderSearchModel { CustomerId = customerId }; return(View(new OrdersListViewModel { Orders = eCommerce.GetOrdersByCustomerId(searchModel, (page - 1) * recordsPerPage, recordsPerPage), PagingInfo = new PagingInfo { CurrentPage = (short)page, RecordsPerPage = recordsPerPage, TotalRecords = eCommerce.CountOrdersByCustomerId(searchModel) }, SearchModel = searchModel })); }