FilterCollection.AddService 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
AddService(Type) |
加入表示 的 IFilterMetadata 型別。 |
AddService(Type, Int32) |
加入表示 的 IFilterMetadata 型別。 |
AddService<TFilterType>() |
加入表示 的 IFilterMetadata 型別。 |
AddService<TFilterType>(Int32) |
加入表示 的 IFilterMetadata 型別。 |
AddService(Type)
加入表示 的 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)
加入表示 的 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>()
加入表示 的 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)
加入表示 的 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) 註冊將透過類型啟用建立的服務。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應