Class SeeOtherResult
- Namespace
- Cuemon.AspNetCore.Mvc
- Assembly
- Cuemon.AspNetCore.Mvc.dll
An ActionResult that returns a SeeOther (303) response with a Location header to the supplied URL.
public class SeeOtherResult : StatusCodeResult, IClientErrorActionResult, IStatusCodeActionResult, IActionResult
- Inheritance
-
SeeOtherResult
- Implements
- Inherited Members
Examples
The following example shows how supports a 303 POST-redirect-GET response.
using System;
using Cuemon.AspNetCore.Mvc;
namespace MyApp.Examples;
public static class SeeOtherResultExample
{
public static void Demonstrate()
{
var result = new SeeOtherResult(new Uri("https://example.com/orders/42"));
Console.WriteLine(result.StatusCode);
Console.WriteLine(result.Location);
}
}
Constructors
SeeOtherResult(Uri)
Initializes a new instance of the SeeOtherResult class.
public SeeOtherResult(Uri location)
Parameters
locationUriThe location of the URL to redirect to.
Properties
Location
Gets the location of the URL to redirect to.
public Uri Location { get; }
Property Value
- Uri
The location of the URL to redirect to.
Methods
ExecuteResultAsync(ActionContext)
Executes the result operation of the action method asynchronously. This method is called by MVC to process the result of an action method.
public override Task ExecuteResultAsync(ActionContext context)
Parameters
contextActionContextThe context in which the result is executed. The context information includes information about the action that was executed and request information.
Returns
- Task
A task that represents the asynchronous execute operation.