ServiceFilterAttribute ServiceFilterAttribute ServiceFilterAttribute Class

Definition

A filter that finds another filter in an IServiceProvider.

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

Remarks

Primarily used in FilterCollection.AddService calls.

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

Constructors

ServiceFilterAttribute(Type) ServiceFilterAttribute(Type) ServiceFilterAttribute(Type)

Instantiates a new ServiceFilterAttribute instance.

Properties

IsReusable IsReusable IsReusable
Order Order Order
ServiceType ServiceType ServiceType

Gets the Type of filter to find.

Methods

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

Applies to