예제 #1
0
 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();
 }
예제 #2
0
 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);
 }