Dela via


RoutingHttpContextExtensions.GetRouteValue(HttpContext, String) Method

Definition

Gets a route value from Values associated with the provided httpContext.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Object ^ GetRouteValue(Microsoft::AspNetCore::Http::HttpContext ^ httpContext, System::String ^ key);
public static object GetRouteValue (this Microsoft.AspNetCore.Http.HttpContext httpContext, string key);
public static object? GetRouteValue (this Microsoft.AspNetCore.Http.HttpContext httpContext, string key);
static member GetRouteValue : Microsoft.AspNetCore.Http.HttpContext * string -> obj
<Extension()>
Public Function GetRouteValue (httpContext As HttpContext, key As String) As Object

Parameters

httpContext
HttpContext

The HttpContext associated with the current request.

key
String

The key of the route value.

Returns

The corresponding route value, or null.

Applies to