共用方式為


PageConventionCollection.AddFolderRouteModelConvention 方法

定義

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

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

參數

folderPath
String

相對於 Razor Pages 根目錄的資料夾路徑。 例如,/Users/

傳回

加入 IPageApplicationModelConvention 的 。

適用於