Exemplo n.º 1
0
        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 }));
            }
        }
Exemplo n.º 2
0
 public async Task <ActionResult> Media(string key)
 {
     return(await DisplayTab(key, () => _pages.GetPageMediaAsync(key)));
 }