TemplatePart.CreateParameter 方法

定义

创建表示 TemplatePart 参数部件的 。

public:
 static Microsoft::AspNetCore::Routing::Template::TemplatePart ^ CreateParameter(System::String ^ name, bool isCatchAll, bool isOptional, System::Object ^ defaultValue, System::Collections::Generic::IEnumerable<Microsoft::AspNetCore::Routing::Template::InlineConstraint ^> ^ inlineConstraints);
public static Microsoft.AspNetCore.Routing.Template.TemplatePart CreateParameter (string name, bool isCatchAll, bool isOptional, object defaultValue, System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Routing.Template.InlineConstraint> inlineConstraints);
public static Microsoft.AspNetCore.Routing.Template.TemplatePart CreateParameter (string name, bool isCatchAll, bool isOptional, object? defaultValue, System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Routing.Template.InlineConstraint>? inlineConstraints);
static member CreateParameter : string * bool * bool * obj * seq<Microsoft.AspNetCore.Routing.Template.InlineConstraint> -> Microsoft.AspNetCore.Routing.Template.TemplatePart
Public Shared Function CreateParameter (name As String, isCatchAll As Boolean, isOptional As Boolean, defaultValue As Object, inlineConstraints As IEnumerable(Of InlineConstraint)) As TemplatePart

参数

name
String

参数的名称。

isCatchAll
Boolean

true 如果参数是 catch-all 参数,则为 。

isOptional
Boolean

true 如果 参数是可选参数,则为 。

defaultValue
Object

参数的默认值。

inlineConstraints
IEnumerable<InlineConstraint>

与 参数关联的约束的集合。

返回

一个 TemplatePart 实例。

适用于