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
routeNamestringThe name of the route to use for generating the URL.
routeValuesIDictionary<string, object>The route data to use for generating the URL.
controllerApiControllerThe 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
routeNamestringThe name of the route to use for generating the URL.
routeValuesIDictionary<string, object>The route data to use for generating the URL.
urlFactoryUrlHelperThe factory to use to generate the route URL.
requestHttpRequestMessageThe 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
cancellationTokenCancellationToken
Returns
- Task<HttpResponseMessage>
Returns Task<TResult>.