RoutingHttpContextExtensions.GetRouteValue(HttpContext, String) 方法

定义

Values 中获取与提供的 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

参数

httpContext
HttpContext

HttpContext 当前请求关联的 。

key
String

路由值的键。

返回

相应的路由值,或 null。

适用于