public ActionResult VehicleMakeList(int?page, string sort, string direction, string search) { var sortParameters = new SortParameters() { Sort = sort, Direction = direction }; var filterParameters = new FilterParameters() { Search = search }; var pagingParameters = new PageParameters() { Page = page ?? 1, PageSize = 3 }; var vehicleMakeList = vehicleMakeService.GetVehicleMakePaged(sortParameters, filterParameters, pagingParameters); ViewBag.search = search; ViewBag.sort = sort; ViewBag.direction = direction; var makeListViewModel = AutoMapper.Mapper.Map <IEnumerable <MakeViewModel> >(vehicleMakeList); return(View(new StaticPagedList <MakeViewModel>(makeListViewModel, vehicleMakeList.GetMetaData()))); }