Пример #1
0
 /// <summary>
 /// Returns redirect result. URL should be absolute.
 /// </summary>
 protected IActionResult Redirect(string url, bool permanent)
 {
     return(permanent ? StatusCodeResult.MovedPermanently(url) : StatusCodeResult.Redirect(url));
 }
Пример #2
0
 /// <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)));
 }
Пример #3
0
 public IActionResult Redirect()
 {
     return(StatusCodeResult.Redirect("/other/go"));
 }