LengthRouteConstraint 类

定义

将路由参数约束为具有给定长度的或者位于给定长度范围内的字符串。

public ref class LengthRouteConstraint : Microsoft::AspNetCore::Routing::IRouteConstraint
public class LengthRouteConstraint : Microsoft.AspNetCore.Routing.IRouteConstraint
public class LengthRouteConstraint : Microsoft.AspNetCore.Routing.IRouteConstraint, Microsoft.AspNetCore.Routing.Matching.IParameterLiteralNodeMatchingPolicy
type LengthRouteConstraint = class
    interface IRouteConstraint
type LengthRouteConstraint = class
    interface IRouteConstraint
    interface IParameterPolicy
type LengthRouteConstraint = class
    interface IParameterPolicy
    interface IRouteConstraint
type LengthRouteConstraint = class
    interface IRouteConstraint
    interface IParameterPolicy
    interface IParameterLiteralNodeMatchingPolicy
Public Class LengthRouteConstraint
Implements IRouteConstraint
Public Class LengthRouteConstraint
Implements IParameterLiteralNodeMatchingPolicy, IRouteConstraint
继承
LengthRouteConstraint
实现

构造函数

LengthRouteConstraint(Int32, Int32)

初始化 类的新实例, LengthRouteConstraint 该类将路由参数约束为具有给定长度的字符串。

LengthRouteConstraint(Int32)

初始化 类的新实例, LengthRouteConstraint 该类将路由参数约束为具有给定长度的字符串。

属性

MaxLength

获取路由参数允许的最大长度。

MinLength

获取路由参数允许的最小长度。

方法

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

确定 URL 参数是否包含此约束的有效值。

显式接口实现

IParameterLiteralNodeMatchingPolicy.MatchesLiteral(String, String)

将路由参数约束为具有给定长度的或者位于给定长度范围内的字符串。

适用于