public ActionResult GetCustomerEventCriticalData(CustomerEventCriticalDataListModelFilter filter = null, int pageNumber = 1) { int totalRecords; if (filter == null) { filter = new CustomerEventCriticalDataListModelFilter(); } var model = _testResultService.GetCustomerwithCriticalData(pageNumber, _pageSize, filter, out totalRecords); if (model == null) { model = new CustomerEventCriticalDataListModel(); } model.Filter = filter; var currentAction = ControllerContext.RouteData.Values["action"].ToString(); Func <int, string> urlFunc = pn => Url.Action(currentAction, new { pageNumber = pn, filter.CustomerName, filter.CustomerId, filter.FromDate, filter.ToDate, filter.EventId }); model.PagingModel = new PagingModel(pageNumber, _pageSize, totalRecords, urlFunc); return(View(model)); }