RoutePatternFactory.Constraint 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
Constraint(IRouteConstraint)
RoutePatternParameterPolicyReference從提供的條件約束建立 。
public:
static Microsoft::AspNetCore::Routing::Patterns::RoutePatternParameterPolicyReference ^ Constraint(Microsoft::AspNetCore::Routing::IRouteConstraint ^ constraint);
public static Microsoft.AspNetCore.Routing.Patterns.RoutePatternParameterPolicyReference Constraint (Microsoft.AspNetCore.Routing.IRouteConstraint constraint);
static member Constraint : Microsoft.AspNetCore.Routing.IRouteConstraint -> Microsoft.AspNetCore.Routing.Patterns.RoutePatternParameterPolicyReference
Public Shared Function Constraint (constraint As IRouteConstraint) As RoutePatternParameterPolicyReference
參數
- constraint
- IRouteConstraint
條件約束物件。
傳回
RoutePatternParameterPolicyReference。
適用於
Constraint(Object)
RoutePatternParameterPolicyReference從提供的限制建立 。
public:
static Microsoft::AspNetCore::Routing::Patterns::RoutePatternParameterPolicyReference ^ Constraint(System::Object ^ constraint);
public static Microsoft.AspNetCore.Routing.Patterns.RoutePatternParameterPolicyReference Constraint (object constraint);
static member Constraint : obj -> Microsoft.AspNetCore.Routing.Patterns.RoutePatternParameterPolicyReference
Public Shared Function Constraint (constraint As Object) As RoutePatternParameterPolicyReference
參數
- constraint
- Object
條件約束物件,其類型必須是 IRouteConstraint 或 String 。 如果條件約束物件是 String ,則會轉換成 的 RegexRouteConstraint 實例。
傳回
RoutePatternParameterPolicyReference。
適用於
Constraint(String)
RoutePatternParameterPolicyReference從提供的條件約束建立 。
public:
static Microsoft::AspNetCore::Routing::Patterns::RoutePatternParameterPolicyReference ^ Constraint(System::String ^ constraint);
public static Microsoft.AspNetCore.Routing.Patterns.RoutePatternParameterPolicyReference Constraint (string constraint);
static member Constraint : string -> Microsoft.AspNetCore.Routing.Patterns.RoutePatternParameterPolicyReference
Public Shared Function Constraint (constraint As String) As RoutePatternParameterPolicyReference
參數
- constraint
- String
條件約束文字,由 解析。 ParameterPolicyFactory
傳回
RoutePatternParameterPolicyReference。