共用方式為


FilterCollectionExtensions.AddForFeature<TFilterType> 方法

定義

新增只有在啟用指定功能時,才會在要求期間啟用的 MVC 篩選準則。

public static Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata AddForFeature<TFilterType> (this Microsoft.AspNetCore.Mvc.Filters.FilterCollection filters, string feature) where TFilterType : Microsoft.AspNetCore.Mvc.Filters.IAsyncActionFilter;
static member AddForFeature : Microsoft.AspNetCore.Mvc.Filters.FilterCollection * string -> Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata (requires 'FilterType :> Microsoft.AspNetCore.Mvc.Filters.IAsyncActionFilter)
<Extension()>
Public Function AddForFeature(Of TFilterType As IAsyncActionFilter) (filters As FilterCollection, feature As String) As IFilterMetadata

類型參數

TFilterType

啟用此功能時要新增並使用的 MVC 篩選器。

參數

filters
FilterCollection

要加入至的篩選集合。

feature
String

必須啟用的功能,才能觸發 MVC 篩選準則的執行。

傳回

適用於