共用方式為


FilterCollection.AddService 方法

定義

多載

AddService(Type)

加入表示 的 IFilterMetadata 型別。

AddService(Type, Int32)

加入表示 的 IFilterMetadata 型別。

AddService<TFilterType>()

加入表示 的 IFilterMetadata 型別。

AddService<TFilterType>(Int32)

加入表示 的 IFilterMetadata 型別。

AddService(Type)

來源:
FilterCollection.cs
來源:
FilterCollection.cs
來源:
FilterCollection.cs

加入表示 的 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

參數

filterType
Type

表示 IFilterMetadata 的型別。

傳回

IFilterMetadata 表示加入的服務類型。

備註

篩選實例將會透過相依性插入來建立。 用來 Add(Type) 註冊將透過類型啟用建立的服務。 新增的篩選將會指派 0 的訂單。

適用於

AddService(Type, Int32)

來源:
FilterCollection.cs
來源:
FilterCollection.cs
來源:
FilterCollection.cs

加入表示 的 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

參數

filterType
Type

表示 IFilterMetadata 的型別。

order
Int32

已加入篩選的順序。

傳回

IFilterMetadata 表示加入的服務類型。

備註

篩選實例將會透過相依性插入來建立。 用來 Add(Type) 註冊將透過類型啟用建立的服務。

適用於

AddService<TFilterType>()

來源:
FilterCollection.cs
來源:
FilterCollection.cs
來源:
FilterCollection.cs

加入表示 的 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

類型參數

TFilterType

表示 IFilterMetadata 的型別。

傳回

IFilterMetadata 表示加入的服務類型。

備註

篩選實例將會透過相依性插入來建立。 用來 Add(Type) 註冊將透過類型啟用建立的服務。 新增的篩選將會指派 0 的訂單。

適用於

AddService<TFilterType>(Int32)

來源:
FilterCollection.cs
來源:
FilterCollection.cs
來源:
FilterCollection.cs

加入表示 的 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

類型參數

TFilterType

表示 IFilterMetadata 的型別。

參數

order
Int32

已加入篩選的順序。

傳回

IFilterMetadata 表示加入的服務類型。

備註

篩選實例將會透過相依性插入來建立。 用來 Add(Type) 註冊將透過類型啟用建立的服務。

適用於