public ActionResult Archive(int year, int month) { AlbumComplexModel model = new AlbumComplexModel(); model.Albums = unitOfWork.AlbumRepository.GetAlbums(filter:(Album a) => (a.Published && a.CreatedOn.Year == year && a.CreatedOn.Month == month)); model.ArchiveEntries = unitOfWork.AlbumRepository.GetArchive(); return View("Index", model); }
// GET: Photos public ActionResult Index() { var firstDay = DateTime.Today.AddDays(-30); AlbumComplexModel model = new AlbumComplexModel(); model.Albums = unitOfWork.AlbumRepository.GetAlbums(filter:(Album a) => (a.Published && a.CreatedOn >= firstDay), includeProp:true); model.ArchiveEntries = unitOfWork.AlbumRepository.GetArchive(); return View(model); }