/// <summary> /// Returns redirect result. URL should be absolute. /// </summary> protected IActionResult Redirect(string url, bool permanent) { return(permanent ? StatusCodeResult.MovedPermanently(url) : StatusCodeResult.Redirect(url)); }
/// <summary> /// Returns redirect result. URL should be absolute. /// </summary> protected async Task <IActionResult> RedirectAsync(string url, bool permanent) { return(await Task.FromResult(permanent?StatusCodeResult.MovedPermanently(url) : StatusCodeResult.Redirect(url))); }
public IActionResult Redirect() { return(StatusCodeResult.Redirect("/other/go")); }