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 如果所有路由值都与其约束匹配,则为 。

适用于