19 instantiations of RedirectResult
BasicWebSite (1)
Filters\RedirectAntiforgeryValidationFailedResultFilter.cs (1)
16
context.Result = new
RedirectResult
("http://example.com/antiforgery-redirect");
Microsoft.AspNetCore.Mvc.Core (5)
ControllerBase.cs (4)
332
return new
RedirectResult
(url);
346
return new
RedirectResult
(url, permanent: true);
361
return new
RedirectResult
(url: url, permanent: false, preserveMethod: true);
376
return new
RedirectResult
(url: url, permanent: true, preserveMethod: true);
RequireHttpsAttribute.cs (1)
98
filterContext.Result = new
RedirectResult
(newUrl, permanentValue);
Microsoft.AspNetCore.Mvc.Core.Test (5)
Infrastructure\ActionMethodExecutorTest.cs (1)
476
public object ReturnIActionResultAsObject() => new
RedirectResult
("/foo");
RedirectResultTest.cs (4)
21
var redirectResult = new
RedirectResult
(contentPath);
41
var result = new
RedirectResult
(url);
56
var result = new
RedirectResult
(url, permanent: true);
71
var result = new
RedirectResult
(url, permanent: true, preserveMethod: true);
Microsoft.AspNetCore.Mvc.RazorPages (8)
PageBase.cs (4)
492
return new
RedirectResult
(url);
505
return new
RedirectResult
(url, permanent: true);
519
return new
RedirectResult
(url: url, permanent: false, preserveMethod: true);
533
return new
RedirectResult
(url: url, permanent: true, preserveMethod: true);
PageModel.cs (4)
821
return new
RedirectResult
(url);
834
return new
RedirectResult
(url, permanent: true);
848
return new
RedirectResult
(url: url, permanent: false, preserveMethod: true);
862
return new
RedirectResult
(url: url, permanent: true, preserveMethod: true);
97 references to RedirectResult
Microsoft.AspNetCore.Mvc.Core (25)
ControllerBase.cs (17)
322
/// Creates a <see cref="
RedirectResult
"/> object that redirects (<see cref="StatusCodes.Status302Found"/>)
326
/// <returns>The created <see cref="
RedirectResult
"/> for the response.</returns>
328
public virtual
RedirectResult
Redirect([StringSyntax(StringSyntaxAttribute.Uri)] string url)
336
/// Creates a <see cref="
RedirectResult
"/> object with <see cref="
RedirectResult
.Permanent"/> set to true
340
/// <returns>The created <see cref="
RedirectResult
"/> for the response.</returns>
342
public virtual
RedirectResult
RedirectPermanent([StringSyntax(StringSyntaxAttribute.Uri)] string url)
350
/// Creates a <see cref="
RedirectResult
"/> object with <see cref="
RedirectResult
.Permanent"/> set to false
351
/// and <see cref="
RedirectResult
.PreserveMethod"/> set to true (<see cref="StatusCodes.Status307TemporaryRedirect"/>)
355
/// <returns>The created <see cref="
RedirectResult
"/> for the response.</returns>
357
public virtual
RedirectResult
RedirectPreserveMethod([StringSyntax(StringSyntaxAttribute.Uri)] string url)
365
/// Creates a <see cref="
RedirectResult
"/> object with <see cref="
RedirectResult
.Permanent"/> set to true
366
/// and <see cref="
RedirectResult
.PreserveMethod"/> set to true (<see cref="StatusCodes.Status308PermanentRedirect"/>)
370
/// <returns>The created <see cref="
RedirectResult
"/> for the response.</returns>
372
public virtual
RedirectResult
RedirectPermanentPreserveMethod([StringSyntax(StringSyntaxAttribute.Uri)] string url)
DependencyInjection\MvcCoreServiceCollectionExtensions.cs (1)
240
services.TryAddSingleton<IActionResultExecutor<
RedirectResult
>, RedirectResultExecutor>();
Infrastructure\RedirectResultExecutor.cs (3)
11
/// A <see cref="IActionResultExecutor{VirtualFileResult}"/> for <see cref="
RedirectResult
"/>.
13
public partial class RedirectResultExecutor : IActionResultExecutor<
RedirectResult
>
33
public virtual Task ExecuteAsync(ActionContext context,
RedirectResult
result)
RedirectResult.cs (4)
20
/// Initializes a new instance of the <see cref="
RedirectResult
"/> class with the values
31
/// Initializes a new instance of the <see cref="
RedirectResult
"/> class with the values
42
/// Initializes a new instance of the <see cref="
RedirectResult
"/> class with the values
93
var executor = context.HttpContext.RequestServices.GetRequiredService<IActionResultExecutor<
RedirectResult
>>();
Microsoft.AspNetCore.Mvc.Core.Test (19)
ControllerBaseTest.cs (8)
48
var
result = controller.Redirect(url);
51
Assert.IsType<
RedirectResult
>(result);
65
var
result = controller.RedirectPermanent(url);
68
Assert.IsType<
RedirectResult
>(result);
82
var
result = controller.RedirectPreserveMethod(url);
85
Assert.IsType<
RedirectResult
>(result);
99
var
result = controller.RedirectPermanentPreserveMethod(url);
102
Assert.IsType<
RedirectResult
>(result);
RedirectResultTest.cs (5)
21
var
redirectResult = new RedirectResult(contentPath);
28
serviceCollection.AddSingleton<IActionResultExecutor<
RedirectResult
>, RedirectResultExecutor>();
41
var
result = new RedirectResult(url);
56
var
result = new RedirectResult(url, permanent: true);
71
var
result = new RedirectResult(url, permanent: true, preserveMethod: true);
RequireHttpsAttributeTests.cs (6)
98
var
result = Assert.IsType<
RedirectResult
>(authContext.Result);
187
var
result = Assert.IsType<
RedirectResult
>(authContext.Result);
215
var
result = Assert.IsType<
RedirectResult
>(authContext.Result);
Microsoft.AspNetCore.Mvc.RazorPages (34)
PageBase.cs (17)
484
/// Creates a <see cref="
RedirectResult
"/> object that redirects to the specified <paramref name="url"/>.
487
/// <returns>The created <see cref="
RedirectResult
"/> for the response.</returns>
488
public virtual
RedirectResult
Redirect([StringSyntax(StringSyntaxAttribute.Uri)] string url)
496
/// Creates a <see cref="
RedirectResult
"/> object with <see cref="
RedirectResult
.Permanent"/> set to true
500
/// <returns>The created <see cref="
RedirectResult
"/> for the response.</returns>
501
public virtual
RedirectResult
RedirectPermanent([StringSyntax(StringSyntaxAttribute.Uri)] string url)
509
/// Creates a <see cref="
RedirectResult
"/> object with <see cref="
RedirectResult
.Permanent"/> set to false
510
/// and <see cref="
RedirectResult
.PreserveMethod"/> set to true (<see cref="StatusCodes.Status307TemporaryRedirect"/>)
514
/// <returns>The created <see cref="
RedirectResult
"/> for the response.</returns>
515
public virtual
RedirectResult
RedirectPreserveMethod([StringSyntax(StringSyntaxAttribute.Uri)] string url)
523
/// Creates a <see cref="
RedirectResult
"/> object with <see cref="
RedirectResult
.Permanent"/> set to true
524
/// and <see cref="
RedirectResult
.PreserveMethod"/> set to true (<see cref="StatusCodes.Status308PermanentRedirect"/>)
528
/// <returns>The created <see cref="
RedirectResult
"/> for the response.</returns>
529
public virtual
RedirectResult
RedirectPermanentPreserveMethod([StringSyntax(StringSyntaxAttribute.Uri)] string url)
PageModel.cs (17)
812
/// Creates a <see cref="
RedirectResult
"/> object that redirects (<see cref="StatusCodes.Status302Found"/>)
816
/// <returns>The created <see cref="
RedirectResult
"/> for the response.</returns>
817
protected internal
RedirectResult
Redirect([StringSyntax(StringSyntaxAttribute.Uri)] string url)
825
/// Creates a <see cref="
RedirectResult
"/> object with <see cref="
RedirectResult
.Permanent"/> set to true
829
/// <returns>The created <see cref="
RedirectResult
"/> for the response.</returns>
830
public virtual
RedirectResult
RedirectPermanent([StringSyntax(StringSyntaxAttribute.Uri)] string url)
838
/// Creates a <see cref="
RedirectResult
"/> object with <see cref="
RedirectResult
.Permanent"/> set to false
839
/// and <see cref="
RedirectResult
.PreserveMethod"/> set to true (<see cref="StatusCodes.Status307TemporaryRedirect"/>)
843
/// <returns>The created <see cref="
RedirectResult
"/> for the response.</returns>
844
public virtual
RedirectResult
RedirectPreserveMethod([StringSyntax(StringSyntaxAttribute.Uri)] string url)
852
/// Creates a <see cref="
RedirectResult
"/> object with <see cref="
RedirectResult
.Permanent"/> set to true
853
/// and <see cref="
RedirectResult
.PreserveMethod"/> set to true (<see cref="StatusCodes.Status308PermanentRedirect"/>)
857
/// <returns>The created <see cref="
RedirectResult
"/> for the response.</returns>
858
public virtual
RedirectResult
RedirectPermanentPreserveMethod([StringSyntax(StringSyntaxAttribute.Uri)] string url)
Microsoft.AspNetCore.Mvc.RazorPages.Test (17)
PageModelTest.cs (9)
42
Assert.IsType<
RedirectResult
>(result);
56
var
result = pageModel.RedirectPermanent(url);
59
Assert.IsType<
RedirectResult
>(result);
73
var
result = pageModel.RedirectPreserveMethod(url);
76
Assert.IsType<
RedirectResult
>(result);
90
var
result = pageModel.RedirectPermanentPreserveMethod(url);
93
Assert.IsType<
RedirectResult
>(result);
1820
var
redirectResult = Assert.IsType<
RedirectResult
>(result);
PageTest.cs (8)
59
var
result = page.Redirect(url);
62
Assert.IsType<
RedirectResult
>(result);
76
var
result = page.RedirectPermanent(url);
79
Assert.IsType<
RedirectResult
>(result);
93
var
result = page.RedirectPreserveMethod(url);
96
Assert.IsType<
RedirectResult
>(result);
110
var
result = page.RedirectPermanentPreserveMethod(url);
113
Assert.IsType<
RedirectResult
>(result);
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (2)
ControllerUnitTestabilityTests.cs (2)
550
var
redirectResult = Assert.IsType<
RedirectResult
>(result);