RoutePatternFactory.Constraint 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
Constraint(IRouteConstraint)
- Source:
- RoutePatternFactory.cs
- Source:
- RoutePatternFactory.cs
从提供的约束创建 。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)
- Source:
- RoutePatternFactory.cs
- Source:
- RoutePatternFactory.cs
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)
- Source:
- RoutePatternFactory.cs
- Source:
- RoutePatternFactory.cs
从提供的约束创建 。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。