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