Example #1
0
        // -------------------- Album  --------------------
        public ActionResult Index(long? albumId)
        {
            if (!albumId.HasValue)
            {
                albumId = AlbumRepository.GetRandom().Id;
            }

            var albums = AlbumRepository.GetAll();
            var model = new AlbumsHomeViewModel
            {
                AlbumId = albumId.Value,
                Albums = albums
            };
            return View("Index", model);
        }
Example #2
0
        public JsonResult GetOneSlide(long albumId)
        {
            var albums = AlbumRepository.GetAll();
            var model = new AlbumsHomeViewModel
            {
                AlbumId = albumId,
                Albums = albums
            };

            var viewToString = RenderRazorViewToString("OneSlide", model);
            return new JsonResult
            {
                Data = viewToString,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            };
        }