TypeFilterAttribute Třída

Definice

Filtr, který vytvoří další filtr typu ImplementationType, načte chybějící argumenty konstruktoru z injektáže závislostí, pokud je k dispozici.

public ref class TypeFilterAttribute : Attribute, Microsoft::AspNetCore::Mvc::Filters::IFilterFactory, Microsoft::AspNetCore::Mvc::Filters::IOrderedFilter
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)]
public class TypeFilterAttribute : Attribute, Microsoft.AspNetCore.Mvc.Filters.IFilterFactory, Microsoft.AspNetCore.Mvc.Filters.IOrderedFilter
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)>]
type TypeFilterAttribute = class
    inherit Attribute
    interface IFilterFactory
    interface IFilterMetadata
    interface IOrderedFilter
Public Class TypeFilterAttribute
Inherits Attribute
Implements IFilterFactory, IOrderedFilter
Dědičnost
TypeFilterAttribute
Odvozené
Atributy
Implementuje

Poznámky

Primárně se používá při FilterCollection.Add voláních.

Podobá se v tom, že oba používají injektáž konstruktoru ServiceFilterAttribute . Použijte ServiceFilterAttribute místo toho, pokud je filtr sám o sobě službou.

Konstruktory

TypeFilterAttribute(Type)

Vytvoří instanci nové TypeFilterAttribute instance.

Vlastnosti

Arguments

Získá nebo nastaví jiné argumenty než služba předat konstruktoru ImplementationType .

ImplementationType

Type Získá filtr , který chcete vytvořit.

IsReusable

Získá hodnotu, která označuje, zda lze výsledek CreateInstance(IServiceProvider) znovu použít napříč požadavky.

Order

Získá hodnotu pořadí pro určení pořadí provádění filtrů. Filtry se spouštějí ve vzestupné číselné hodnotě Order vlastnosti .

Metody

CreateInstance(IServiceProvider)

Vytvoří instanci spustitelného filtru.

Platí pro