I​Route​Constraint I​Route​Constraint Interface

Definition

Defines the contract that a class must implement in order to check whether a URL parameter value is valid for a constraint.
public interface IRouteConstraintPublic Interface IRouteConstraint

Methods

Match(HttpContext, IRouter, String, RouteValueDictionary, RouteDirection) Match(HttpContext, IRouter, String, RouteValueDictionary, RouteDirection)

Determines whether the URL parameter contains a valid value for this constraint.
bool Match(HttpContext httpContext, IRouter route, string routeKey, RouteValueDictionary values, RouteDirection routeDirection)Function Match(httpContext As HttpContext, route As IRouter, routeKey As String, values As RouteValueDictionary, routeDirection As RouteDirection) As Boolean
Parameters
httpContext
HttpContext HttpContext
An object that encapsulates information about the HTTP request.
route
IRouter IRouter
The router that this constraint belongs to.
routeKey
System.String System.String
The name of the parameter that is being checked.
values
RouteValueDictionary RouteValueDictionary
A dictionary that contains the parameters for the URL.
routeDirection
RouteDirection RouteDirection
An object that indicates whether the constraint check is being performed when an incoming request is being handled or when a URL is being generated.
Returns
System.Boolean System.Boolean
true if the URL parameter contains a valid value; otherwise, false.