TypeFilterAttribute Classe

Definizione

Filtro che crea un altro filtro di tipo ImplementationType, recuperando gli argomenti del costruttore mancanti dall'inserimento delle dipendenze, se disponibile.

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
Ereditarietà
TypeFilterAttribute
Derivato
Attributi
Implementazioni

Commenti

Usato principalmente nelle FilterCollection.Add chiamate.

Analogamente a in che entrambi usano l'inserimento ServiceFilterAttribute del costruttore. Usare ServiceFilterAttribute invece se il filtro è un servizio.

Costruttori

TypeFilterAttribute(Type)

Crea un'istanza di una nuova TypeFilterAttribute istanza.

Proprietà

Arguments

Ottiene o imposta gli argomenti non di servizio da passare al ImplementationType costruttore.

ImplementationType

Ottiene l'oggetto Type del filtro da creare.

IsReusable

Ottiene un valore che indica se il risultato di CreateInstance(IServiceProvider) può essere riutilizzato tra le richieste.

Order

Ottiene il valore dell'ordine per determinare l'ordine di esecuzione dei filtri. I filtri vengono eseguiti in un valore numerico crescente della Order proprietà .

Metodi

CreateInstance(IServiceProvider)

Crea un'istanza del filtro eseguibile.

Si applica a