public ActionResult EventResultsStatus(EventResultStatusViewModelFilter filter = null, int pageNumber = 1) { int totalRecords = 0; //if (!filter.EventDateFrom.HasValue) // filter.EventDateFrom = DateTime.Now.Date; var model = _testResultService.GetEventResultStatusList(pageNumber, _pageSize, filter, out totalRecords); if (model == null) { model = new EventResultStatusListModel(); } model.Filter = filter; var currentAction = ControllerContext.RouteData.Values["action"].ToString(); Func <int, string> urlFunc = pn => Url.Action(currentAction, new { pageNumber = pn, filter.EventId, filter.EventDateFrom, filter.EventDateTo, filter.Status, filter.PodId }); model.PagingModel = new PagingModel(pageNumber, _pageSize, totalRecords, urlFunc); return(View(model)); }