public ActionResult GetRedirects()
        {
            var redirectSearchResults = _redirectRepository.GetRedirects();
            var redirects             = redirectSearchResults.Select(r => new RedirectJsonModel
            {
                Type       = r.RedirectType,
                OldUrl     = r.OldUrl,
                NewUrl     = r.NewUrl,
                KeepParams = r.KeepParams
            }).ToList();

            return(Json(redirects, JsonRequestBehavior.AllowGet));
        }
        public ActionResult Redirect([FromServices] IRedirectRepository repository, string url)
        {
            var redirect = repository.GetRedirects().Where(x => x.Value.Where(y => y.Url.ToLower() == url.ToLower() && y.RedirectByParameter).Count() > 0);

            if (redirect == null || redirect.Count() == 0)
            {
                return(new RedirectResult("/errors/status/404"));
            }
            else
            {
                var redirectUrl = "/blog/" + redirect.First().Key;
                var perm        = redirect.First().Value.Where(y => y.Url.ToLower() == url.ToLower() && y.RedirectByParameter).First().RedirectType == System.Net.HttpStatusCode.MovedPermanently;
                return(new RedirectResult(redirectUrl, perm));
            }
        }