public async Task <ActionResult> Media(string key) { var encKey = PageHelper.EncodeTitle(key); if (encKey != key) { return(RedirectToActionPermanent("Media", new { key = encKey })); } try { ViewBag.User = await _auth.GetCurrentUserAsync(User); var vm = new PageVM <PageMediaVM> { Body = await _cache.GetOrAddAsync(key, async() => await _pages.GetPageMediaAsync(key)), InfoBlock = await _cache.GetOrAddAsync(key, async() => await _pages.GetPageInfoBlockAsync(key)) }; return(View(vm)); } catch (RedirectRequiredException ex) { return(RedirectToActionPermanent("Description", new { key = ex.Key })); } }
public async Task <ActionResult> Media(string key) { return(await DisplayTab(key, () => _pages.GetPageMediaAsync(key))); }