IRouteConstraint IRouteConstraint Interface

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

Syntax

Declaration

public interface IRouteConstraintPublic Interface IRouteConstraint

Methods summary

Determines whether the URL parameter contains a valid value for this constraint.

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
      An object that encapsulates information about the HTTP request.
    • route
      The router that this constraint belongs to.
    • routeKey
      System.String
      System.String
      The name of the parameter that is being checked.
    • values
      A dictionary that contains the parameters for the URL.
    • 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.

Details

Assembly

Microsoft.AspNetCore.Routing.Abstractions.dll