共用方式為


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。

適用於