TypeFilterAttribute TypeFilterAttribute TypeFilterAttribute Class

Definition

A filter that creates another filter of type ImplementationType, retrieving missing constructor arguments from dependency injection if available there.

[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
type TypeFilterAttribute = class
    inherit Attribute
    interface IFilterFactory
    interface IFilterMetadata
    interface IOrderedFilter
Public Class TypeFilterAttribute
Inherits Attribute
Implements IFilterFactory, IOrderedFilter
Inheritance
TypeFilterAttributeTypeFilterAttributeTypeFilterAttribute
Attributes
Implements

Remarks

Primarily used in FilterCollection.Add calls.

Similar to the ServiceFilterAttribute in that both use constructor injection. Use ServiceFilterAttribute instead if the filter is itself a service.

Constructors

TypeFilterAttribute(Type) TypeFilterAttribute(Type) TypeFilterAttribute(Type)

Instantiates a new TypeFilterAttribute instance.

Properties

Arguments Arguments Arguments

Gets or sets the non-service arguments to pass to the ImplementationType constructor.

ImplementationType ImplementationType ImplementationType

Gets the Type of filter to create.

IsReusable IsReusable IsReusable
Order Order Order

Methods

CreateInstance(IServiceProvider) CreateInstance(IServiceProvider) CreateInstance(IServiceProvider)

Applies to