HttpMethodConstraint.IRouteConstraint.Match 方法

定义

 virtual bool System.Web.Routing.IRouteConstraint.Match(System::Web::HttpContextBase ^ httpContext, System::Web::Routing::Route ^ route, System::String ^ parameterName, System::Web::Routing::RouteValueDictionary ^ values, System::Web::Routing::RouteDirection routeDirection) = System::Web::Routing::IRouteConstraint::Match;
bool IRouteConstraint.Match (System.Web.HttpContextBase httpContext, System.Web.Routing.Route route, string parameterName, System.Web.Routing.RouteValueDictionary values, System.Web.Routing.RouteDirection routeDirection);
abstract member System.Web.Routing.IRouteConstraint.Match : System.Web.HttpContextBase * System.Web.Routing.Route * string * System.Web.Routing.RouteValueDictionary * System.Web.Routing.RouteDirection -> bool
override this.System.Web.Routing.IRouteConstraint.Match : System.Web.HttpContextBase * System.Web.Routing.Route * string * System.Web.Routing.RouteValueDictionary * System.Web.Routing.RouteDirection -> bool
Function Match (httpContext As HttpContextBase, route As Route, parameterName As String, values As RouteValueDictionary, routeDirection As RouteDirection) As Boolean Implements IRouteConstraint.Match

参数

httpContext
HttpContextBase

一个对象,该对象封装有关 HTTP 请求的信息。

route
Route

检查以确定其是否与 URL 匹配的对象。

parameterName
String

要检查的参数的名称。

values
RouteValueDictionary

一个包含路由参数的对象。

routeDirection
RouteDirection

一个对象,该对象指示在处理传入请求或生成 URL 时,是否正在执行约束检查。

返回

如果该请求是通过使用允许的 HTTP 谓词进行的,则为 true;否则为 false。 默认值为 true

实现

例外

以下一个或多个参数为 nullhttpContextrouteparameterNamevalues

注解

此成员是显式接口成员的实现。 它只能在 HttpMethodConstraint 实例被强制转换为 IRouteConstraint 接口时使用。

适用于

另请参阅