public ActionResult List() { if (!Session.IsSignedIn()) { return(RedirectToAction("Index", "Home")); } var model = new DonorListViewModel { Donors = donorService.FindAll() }; return(View(model)); }
public ActionResult Index(int?page) { int pageSize = 10; int pageIndex = (page ?? 1); var allDonors = this.donorProfileService.List().Project().To <DonorViewModel>(); var donorsPagedList = allDonors.ToPagedList(pageIndex, pageSize); var viewModel = new DonorListViewModel(); viewModel.Donors = donorsPagedList; return(View(viewModel)); }