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

Syntax

public interface IRouteConstraint
interface Microsoft.AspNetCore.Routing.IRouteConstraint

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:
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)