Sdílet prostřednictvím


FilterCollectionExtensions.AddForFeature<TFilterType> Metoda

Definice

Přidá filtr MVC, který se aktivuje pouze během požadavku, pokud je povolená zadaná funkce.

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

Parametry typu

TFilterType

Filtr MVC, který se má přidat a použít, pokud je funkce povolená.

Parametry

filters
FilterCollection

Kolekce filtrů, do které se má přidat.

feature
String

Funkce, která bude muset povolit spuštění filtru MVC.

Návraty

Platí pro