private GalleryLink[] GetGalleryLinks(int pageIndex) { IEnumerable <Gallery> latestGalleries = GetLatest(pageIndex * NextPreviousOptions.EntriesPerPageMaxCount, NextPreviousOptions.EntriesPerPageMaxCount); return(latestGalleries.Select(g => { GalleryLink galleryLink = new GalleryLink(); galleryLink.InjectFrom(g); return galleryLink; }).ToArray()); }
public ActionResult Index() { IEnumerable <GalleryLink> galleryLinks = galleriesRepository.Galleries .OrderByDescending(g => g.PublishDate) .ToArray() .Select(g => { GalleryLink galleryLink = new GalleryLink(); galleryLink.InjectFrom(g); return(galleryLink); }); return(View(galleryLinks)); }