PageConventionCollectionExtensions.ConfigureFilter 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
ConfigureFilter(PageConventionCollection, IFilterMetadata) |
設定要套用至所有 Razor Pages 的指定 |
ConfigureFilter(PageConventionCollection, Func<PageApplicationModel,IFilterMetadata>) |
設定指定的 |
ConfigureFilter(PageConventionCollection, IFilterMetadata)
設定要套用至所有 Razor Pages 的指定 filter
。
public static Microsoft.AspNetCore.Mvc.ApplicationModels.PageConventionCollection ConfigureFilter (this Microsoft.AspNetCore.Mvc.ApplicationModels.PageConventionCollection conventions, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata filter);
static member ConfigureFilter : Microsoft.AspNetCore.Mvc.ApplicationModels.PageConventionCollection * Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata -> Microsoft.AspNetCore.Mvc.ApplicationModels.PageConventionCollection
<Extension()>
Public Function ConfigureFilter (conventions As PageConventionCollection, filter As IFilterMetadata) As PageConventionCollection
參數
- conventions
- PageConventionCollection
要設定的 PageConventionCollection。
- filter
- IFilterMetadata
要加入的 IFilterMetadata。
傳回
適用於
ConfigureFilter(PageConventionCollection, Func<PageApplicationModel,IFilterMetadata>)
設定指定的 factory
,以將篩選套用至所有 Razor Pages。
public static Microsoft.AspNetCore.Mvc.ApplicationModels.IPageApplicationModelConvention ConfigureFilter (this Microsoft.AspNetCore.Mvc.ApplicationModels.PageConventionCollection conventions, Func<Microsoft.AspNetCore.Mvc.ApplicationModels.PageApplicationModel,Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata> factory);
static member ConfigureFilter : Microsoft.AspNetCore.Mvc.ApplicationModels.PageConventionCollection * Func<Microsoft.AspNetCore.Mvc.ApplicationModels.PageApplicationModel, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata> -> Microsoft.AspNetCore.Mvc.ApplicationModels.IPageApplicationModelConvention
<Extension()>
Public Function ConfigureFilter (conventions As PageConventionCollection, factory As Func(Of PageApplicationModel, IFilterMetadata)) As IPageApplicationModelConvention
參數
- conventions
- PageConventionCollection
要設定的 PageConventionCollection。
- factory
- Func<PageApplicationModel,IFilterMetadata>
要建立篩選的處理站。