Class RedirectToRouteResult
Represents an action result that performs route generation and returns a <see cref="F:System.Net.HttpStatusCode.Redirect"/> response.
public class RedirectToRouteResult : IHttpActionResult
- Inheritance
-
RedirectToRouteResult
- Implements
- Inherited Members
Constructors
RedirectToRouteResult(string, IDictionary<string, object>, ApiController)
Initializes a new instance of the <see cref="T:System.Web.Http.Results.RedirectToRouteResult"/> class with the values provided.
public RedirectToRouteResult(string routeName, IDictionary<string, object> routeValues, ApiController controller)
Parameters
routeName
stringThe name of the route to use for generating the URL.
routeValues
IDictionary<string, object>The route data to use for generating the URL.
controller
ApiControllerThe controller from which to obtain the dependencies needed for execution.
RedirectToRouteResult(string, IDictionary<string, object>, UrlHelper, HttpRequestMessage)
Initializes a new instance of the <see cref="T:System.Web.Http.Results.RedirectToRouteResult"/> class with the values provided.
public RedirectToRouteResult(string routeName, IDictionary<string, object> routeValues, UrlHelper urlFactory, HttpRequestMessage request)
Parameters
routeName
stringThe name of the route to use for generating the URL.
routeValues
IDictionary<string, object>The route data to use for generating the URL.
urlFactory
UrlHelperThe factory to use to generate the route URL.
request
HttpRequestMessageThe request message which led to this result.
Properties
Request
Gets the request message which led to this result.
public HttpRequestMessage Request { get; }
Property Value
- HttpRequestMessage
Returns HttpRequestMessage.
RouteName
Gets the name of the route to use for generating the URL.
public string RouteName { get; }
Property Value
RouteValues
Gets the route data to use for generating the URL.
public IDictionary<string, object> RouteValues { get; }
Property Value
- IDictionary<string, object>
Returns IDictionary<TKey, TValue>.
UrlFactory
Gets the factory to use to generate the route URL.
public UrlHelper UrlFactory { get; }
Property Value
Methods
ExecuteAsync(CancellationToken)
public virtual Task<HttpResponseMessage> ExecuteAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationToken
Returns
- Task<HttpResponseMessage>
Returns Task<TResult>.