共用方式為


PageConventionCollection.AddAreaFolderRouteModelConvention 方法

定義

建立並新增 , IPageRouteModelConvention 在指定區域資料夾下的所有頁面實例上 PageRouteModel 叫用動作。

public:
 Microsoft::AspNetCore::Mvc::ApplicationModels::IPageRouteModelConvention ^ AddAreaFolderRouteModelConvention(System::String ^ areaName, System::String ^ folderPath, Action<Microsoft::AspNetCore::Mvc::ApplicationModels::PageRouteModel ^> ^ action);
public Microsoft.AspNetCore.Mvc.ApplicationModels.IPageRouteModelConvention AddAreaFolderRouteModelConvention (string areaName, string folderPath, Action<Microsoft.AspNetCore.Mvc.ApplicationModels.PageRouteModel> action);
member this.AddAreaFolderRouteModelConvention : string * string * Action<Microsoft.AspNetCore.Mvc.ApplicationModels.PageRouteModel> -> Microsoft.AspNetCore.Mvc.ApplicationModels.IPageRouteModelConvention
Public Function AddAreaFolderRouteModelConvention (areaName As String, folderPath As String, action As Action(Of PageRouteModel)) As IPageRouteModelConvention

參數

areaName
String

區功能變數名稱稱。

folderPath
String

資料夾路徑,例如 /Manage/

資料夾路徑是資料夾的路徑,相對於指定區域的 pages 根目錄。 例如,Areas/Identity/Pages/Manage/Accounts.cshtml 檔案的資料夾路徑是 /Manage

傳回

加入 IPageApplicationModelConvention 的 。

適用於