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

适用于