public static ActionResult ResolveArticleBase(WikiArticleViewModelBase model, RequestContext requestContext)
        {
            var ensuredActionResult = ResolveEnsuredAlternativeActionResult(model, requestContext);
            if (ensuredActionResult != null)
            {
                return ensuredActionResult;
            }

            return null;
        }
        public static IHtmlString WikiArticleJsVariables(this HtmlHelper htmlHelper, WikiArticleViewModelBase model)
        {
            string articleSlugHtml = string.Format("window.WikiDown.articleSlug = '{0}';", model.ArticleSlug.Slug);

            string redirectToArticleHashHtml = string.Format(
                "window.WikiDown.redirectToArticleHash = '{0}';",
                model.RedirectToArticleHash);

            string html = string.Format("{1}{0}{2}", Environment.NewLine, articleSlugHtml, redirectToArticleHashHtml);
            return new HtmlString(html);
        }
        private static ActionResult ResolveEnsuredAlternativeActionResult(
            WikiArticleViewModelBase model,
            RequestContext requestContext)
        {
            string ensured = EnsureSlugHelper.Ensure(model.RouteName, requestContext.HttpContext);
            if (!string.IsNullOrWhiteSpace(ensured))
            {
                string redirectUrl = model.RedirectUrlFactory(model.ArticleSlug);
                return !string.IsNullOrWhiteSpace(redirectUrl) ? new RedirectResult(redirectUrl) : null;
            }

            return null;
        }
 public static IHtmlString WikiArticleNavigation(this HtmlHelper htmlHelper, WikiArticleViewModelBase model)
 {
     return htmlHelper.Partial(ArticleNavigationViewName, model);
 }