共用方式為


RoutePattern.RequiredValues 屬性

定義

取得路由值的集合,這些值必須提供給此路由模式才能視為適用。

public:
 property System::Collections::Generic::IReadOnlyDictionary<System::String ^, System::Object ^> ^ RequiredValues { System::Collections::Generic::IReadOnlyDictionary<System::String ^, System::Object ^> ^ get(); };
public System.Collections.Generic.IReadOnlyDictionary<string,object> RequiredValues { get; }
public System.Collections.Generic.IReadOnlyDictionary<string,object?> RequiredValues { get; }
member this.RequiredValues : System.Collections.Generic.IReadOnlyDictionary<string, obj>
Public ReadOnly Property RequiredValues As IReadOnlyDictionary(Of String, Object)

屬性值

備註

RequiredValues 允許架構將路由值取代為參數化範本,以便使用相同的路由範本規格來建立多個路由模式。

Route Template: "{controller=Home}/{action=Index}/{id?}"
Route Values: { controller = "Store", action = "Index" }

以此方式產生的路由模式會比對並產生 URL 路徑,例如: /Store/Store/Index/Store/Index/17

適用於