RoutingHttpContextExtensions Class

Extension methods for Microsoft.AspNetCore.Http.HttpContext related to routing.

Namespace
Microsoft.AspNetCore.Routing
Assemblies
  • Microsoft.AspNetCore.Routing.Abstractions

Syntax

public class RoutingHttpContextExtensions
class Microsoft.AspNetCore.Routing.RoutingHttpContextExtensions

Methods

GetRouteData(Microsoft.AspNetCore.Http.HttpContext)

Gets the Microsoft.AspNetCore.Routing.RouteData associated with the provided <em>httpContext</em>.

Arguments:httpContext (Microsoft.AspNetCore.Http.HttpContext) – The Microsoft.AspNetCore.Http.HttpContext associated with the current request.
Return type:Microsoft.AspNetCore.Routing.RouteData
Returns:The Microsoft.AspNetCore.Routing.RouteData, or null.
public static RouteData GetRouteData(this HttpContext httpContext)
GetRouteValue(Microsoft.AspNetCore.Http.HttpContext, System.String)

Gets a route value from Microsoft.AspNetCore.Routing.RouteData.Values associated with the provided <em>httpContext</em>.

Arguments:
Return type:

System.Object

Returns:

The corresponding route value, or null.

public static object GetRouteValue(this HttpContext httpContext, string key)