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.RouteDataassociated with the provided <em>httpContext</em>.Arguments: httpContext (Microsoft.AspNetCore.Http.HttpContext) – The Microsoft.AspNetCore.Http.HttpContextassociated 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.Valuesassociated with the provided <em>httpContext</em>.Arguments: - httpContext (Microsoft.AspNetCore.Http.HttpContext) – The
Microsoft.AspNetCore.Http.HttpContextassociated with the current request. - key (System.String) – The key of the route value.
Return type: System.Object
Returns: The corresponding route value, or null.
public static object GetRouteValue(this HttpContext httpContext, string key)
- httpContext (Microsoft.AspNetCore.Http.HttpContext) – The
-