public ActionResult Index() { var allPages = this.pagesData.All().OrderByDescending(p => p.CreatedOn); var pages = this.Mapper.Map <PageViewModel>(allPages).ToList(); var model = new IndexPagesViewModel { Pages = pages }; return(this.View(model)); }
// GET: Administration/Pages public ActionResult Index() { var pages = this.Data.Pages .All() .OrderByDescending(p => p.CreatedOn) .To<PageViewModel>(); var model = new IndexPagesViewModel { Pages = pages.ToList() }; return this.View(model); }