FilterCollection.AddService Method

Definition

Overloads

AddService(Type)

Adds a type representing a IFilterMetadata.

AddService(Type, Int32)

Adds a type representing a IFilterMetadata.

AddService<TFilterType>()

Adds a type representing a IFilterMetadata.

AddService<TFilterType>(Int32)

Adds a type representing a IFilterMetadata.

AddService(Type)

Source:
FilterCollection.cs
Source:
FilterCollection.cs

Adds a type representing a IFilterMetadata.

public:
 Microsoft::AspNetCore::Mvc::Filters::IFilterMetadata ^ AddService(Type ^ filterType);
public Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata AddService (Type filterType);
member this.AddService : Type -> Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata
Public Function AddService (filterType As Type) As IFilterMetadata

Parameters

filterType
Type

Type representing a IFilterMetadata.

Returns

A IFilterMetadata representing the added service type.

Remarks

Filter instances will be created through dependency injection. Use Add(Type) to register a service that will be created via type activation. The added filter will be assigned an order of 0.

Applies to

AddService(Type, Int32)

Source:
FilterCollection.cs
Source:
FilterCollection.cs

Adds a type representing a IFilterMetadata.

public:
 Microsoft::AspNetCore::Mvc::Filters::IFilterMetadata ^ AddService(Type ^ filterType, int order);
public Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata AddService (Type filterType, int order);
member this.AddService : Type * int -> Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata
Public Function AddService (filterType As Type, order As Integer) As IFilterMetadata

Parameters

filterType
Type

Type representing a IFilterMetadata.

order
Int32

The order of the added filter.

Returns

A IFilterMetadata representing the added service type.

Remarks

Filter instances will be created through dependency injection. Use Add(Type) to register a service that will be created via type activation.

Applies to

AddService<TFilterType>()

Source:
FilterCollection.cs
Source:
FilterCollection.cs

Adds a type representing a IFilterMetadata.

public:
generic <typename TFilterType>
 where TFilterType : Microsoft::AspNetCore::Mvc::Filters::IFilterMetadata Microsoft::AspNetCore::Mvc::Filters::IFilterMetadata ^ AddService();
public Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata AddService<TFilterType> () where TFilterType : Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata;
member this.AddService : unit -> Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata (requires 'FilterType :> Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata)
Public Function AddService(Of TFilterType As IFilterMetadata) () As IFilterMetadata

Type Parameters

TFilterType

Type representing a IFilterMetadata.

Returns

A IFilterMetadata representing the added service type.

Remarks

Filter instances will be created through dependency injection. Use Add(Type) to register a service that will be created via type activation. The added filter will be assigned an order of 0.

Applies to

AddService<TFilterType>(Int32)

Source:
FilterCollection.cs
Source:
FilterCollection.cs

Adds a type representing a IFilterMetadata.

public:
generic <typename TFilterType>
 where TFilterType : Microsoft::AspNetCore::Mvc::Filters::IFilterMetadata Microsoft::AspNetCore::Mvc::Filters::IFilterMetadata ^ AddService(int order);
public Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata AddService<TFilterType> (int order) where TFilterType : Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata;
member this.AddService : int -> Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata (requires 'FilterType :> Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata)
Public Function AddService(Of TFilterType As IFilterMetadata) (order As Integer) As IFilterMetadata

Type Parameters

TFilterType

Type representing a IFilterMetadata.

Parameters

order
Int32

The order of the added filter.

Returns

A IFilterMetadata representing the added service type.

Remarks

Filter instances will be created through dependency injection. Use Add(Type) to register a service that will be created via type activation.

Applies to