/// <summary> /// Creates a <see cref="LocalRedirectResult"/> object that redirects to the specified local localUrl /// </summary> /// <param name="controller"></param> /// <param name="localUrl">The local URL to redirect to.</param> /// <param name="escapeUrl">Whether to escape the url.</param> public static ActionResult LocalRedirect(this Controller controller, string localUrl, bool escapeUrl) { if (!escapeUrl) { return(controller.LocalRedirect(localUrl)); } return(controller.LocalRedirect(localUrl.ToUriComponents())); }