IRouteConstraint Interface¶
Defines the contract that a class must implement in order to check whether a URL parameter value is valid for a constraint.
- Namespace
Microsoft.AspNetCore.Routing
- Assemblies
- Microsoft.AspNetCore.Routing.Abstractions
Methods¶
-
Match
(Microsoft.AspNetCore.Http.HttpContext, Microsoft.AspNetCore.Routing.IRouter, System.String, Microsoft.AspNetCore.Routing.RouteValueDictionary, Microsoft.AspNetCore.Routing.RouteDirection)¶ Determines whether the URL parameter contains a valid value for this constraint.
Arguments: - httpContext (Microsoft.AspNetCore.Http.HttpContext) – An object that encapsulates information about the HTTP request.
- route (Microsoft.AspNetCore.Routing.IRouter) – The router that this constraint belongs to.
- routeKey (System.String) – The name of the parameter that is being checked.
- values (Microsoft.AspNetCore.Routing.RouteValueDictionary) – A dictionary that contains the parameters for the URL.
- routeDirection (Microsoft.AspNetCore.Routing.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.
Return type: System.Boolean
Returns: <code>true</code> if the URL parameter contains a valid value; otherwise, <code>false</code>.
bool Match(HttpContext httpContext, IRouter route, string routeKey, RouteValueDictionary values, RouteDirection routeDirection)
-