共用方式為


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 執行個體。

適用於