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)

初始化 類別的新實例, LengthRouteConstraint 將路由參數限制為指定長度的字串。

LengthRouteConstraint(Int32, Int32)

初始化 類別的新實例, LengthRouteConstraint 將路由參數限制為指定長度的字串。

屬性

MaxLength

取得路由參數允許的最大長度。

MinLength

取得路由參數允許的最小長度。

方法

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

判斷 URL 參數是否包含對這個條件約束有效的值。

明確介面實作

IParameterLiteralNodeMatchingPolicy.MatchesLiteral(String, String)

限制路由參數為給定長度的字串,或位於給定長度範圍內。

適用於