共用方式為


RouteConstraintMatcher.Match 方法

定義

判斷是否符合 routeValues 提供的 constraints

public:
 static bool Match(System::Collections::Generic::IDictionary<System::String ^, Microsoft::AspNetCore::Routing::IRouteConstraint ^> ^ constraints, Microsoft::AspNetCore::Routing::RouteValueDictionary ^ routeValues, Microsoft::AspNetCore::Http::HttpContext ^ httpContext, Microsoft::AspNetCore::Routing::IRouter ^ route, Microsoft::AspNetCore::Routing::RouteDirection routeDirection, Microsoft::Extensions::Logging::ILogger ^ logger);
public static bool Match (System.Collections.Generic.IDictionary<string,Microsoft.AspNetCore.Routing.IRouteConstraint> constraints, Microsoft.AspNetCore.Routing.RouteValueDictionary routeValues, Microsoft.AspNetCore.Http.HttpContext httpContext, Microsoft.AspNetCore.Routing.IRouter route, Microsoft.AspNetCore.Routing.RouteDirection routeDirection, Microsoft.Extensions.Logging.ILogger logger);
static member Match : System.Collections.Generic.IDictionary<string, Microsoft.AspNetCore.Routing.IRouteConstraint> * Microsoft.AspNetCore.Routing.RouteValueDictionary * Microsoft.AspNetCore.Http.HttpContext * Microsoft.AspNetCore.Routing.IRouter * Microsoft.AspNetCore.Routing.RouteDirection * Microsoft.Extensions.Logging.ILogger -> bool
Public Shared Function Match (constraints As IDictionary(Of String, IRouteConstraint), routeValues As RouteValueDictionary, httpContext As HttpContext, route As IRouter, routeDirection As RouteDirection, logger As ILogger) As Boolean

參數

constraints
IDictionary<String,IRouteConstraint>

路由的條件約束。

routeValues
RouteValueDictionary

從相符路由擷取的路由參數值。

httpContext
HttpContext

HttpContext 目前要求相關聯的 。

route
IRouter

此條件約束所屬的路由器。

routeDirection
RouteDirection

指出當處理傳入要求或產生 URL 時,是否執行條件約束檢查。

傳回

true 如果所有路由值都符合其條件約束,則為 。

適用於