Route.ProcessConstraint Method

Definition

Determines whether a parameter value matches the constraint for that parameter.

C#
protected virtual bool ProcessConstraint(System.Web.HttpContextBase httpContext, object constraint, string parameterName, System.Web.Routing.RouteValueDictionary values, System.Web.Routing.RouteDirection routeDirection);

Parameters

httpContext
HttpContextBase

An object that encapsulates information about the HTTP request.

constraint
Object

The regular expression or object to use to test parameterName.

parameterName
String

The name of the parameter to test.

values
RouteValueDictionary

The values to test.

routeDirection
RouteDirection

A value that specifies whether URL routing is processing an incoming request or constructing a URL.

Returns

true if the parameter value matches the constraint; otherwise, false.

Exceptions

constraint is not a string that contains a regular expression.

Applies to

Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also