ServiceFilterAttribute Classe

Definizione

Filtro che trova un altro filtro in un IServiceProvideroggetto .

public ref class ServiceFilterAttribute : 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 ServiceFilterAttribute : Attribute, Microsoft.AspNetCore.Mvc.Filters.IFilterFactory, Microsoft.AspNetCore.Mvc.Filters.IOrderedFilter
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)>]
type ServiceFilterAttribute = class
    inherit Attribute
    interface IFilterFactory
    interface IFilterMetadata
    interface IOrderedFilter
Public Class ServiceFilterAttribute
Inherits Attribute
Implements IFilterFactory, IOrderedFilter
Ereditarietà
ServiceFilterAttribute
Derivato
Attributi
Implementazioni

Commenti

Usato principalmente nelle FilterCollection.AddService chiamate.

Simile all'oggetto in cui entrambi usano l'inserimento TypeFilterAttribute del costruttore. Usare TypeFilterAttribute invece se il filtro non è un servizio.

Costruttori

ServiceFilterAttribute(Type)

Crea un'istanza di una nuova ServiceFilterAttribute istanza.

Proprietà

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 valore numerico crescente della Order proprietà.

ServiceType

Ottiene l'oggetto Type del filtro da trovare.

Metodi

CreateInstance(IServiceProvider)

Crea un'istanza del filtro eseguibile.

Si applica a