ServiceProviderKeyedServiceExtensions.GetKeyedServices 方法

定義

多載

GetKeyedServices(IServiceProvider, Type, Object)

IServiceProvider取得 型serviceType別服務的列舉。

GetKeyedServices<T>(IServiceProvider, Object)

IServiceProvider取得 型T別服務的列舉。

GetKeyedServices(IServiceProvider, Type, Object)

來源:
ServiceProviderKeyedServiceExtensions.cs
來源:
ServiceProviderKeyedServiceExtensions.cs
來源:
ServiceProviderKeyedServiceExtensions.cs
來源:
ServiceProviderKeyedServiceExtensions.cs

IServiceProvider取得 型serviceType別服務的列舉。

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<System::Object ^> ^ GetKeyedServices(IServiceProvider ^ provider, Type ^ serviceType, System::Object ^ serviceKey);
public static System.Collections.Generic.IEnumerable<object?> GetKeyedServices (this IServiceProvider provider, Type serviceType, object? serviceKey);
static member GetKeyedServices : IServiceProvider * Type * obj -> seq<obj>
<Extension()>
Public Function GetKeyedServices (provider As IServiceProvider, serviceType As Type, serviceKey As Object) As IEnumerable(Of Object)

參數

provider
IServiceProvider

要從其中擷取服務的 IServiceProvider

serviceType
Type

物件,指定要取得的服務物件類型。

serviceKey
Object

物件,指定要取得之服務物件的索引鍵。

傳回

類型 serviceType 服務的列舉。

適用於

GetKeyedServices<T>(IServiceProvider, Object)

來源:
ServiceProviderKeyedServiceExtensions.cs
來源:
ServiceProviderKeyedServiceExtensions.cs
來源:
ServiceProviderKeyedServiceExtensions.cs
來源:
ServiceProviderKeyedServiceExtensions.cs

IServiceProvider取得 型T別服務的列舉。

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<T> ^ GetKeyedServices(IServiceProvider ^ provider, System::Object ^ serviceKey);
public static System.Collections.Generic.IEnumerable<T> GetKeyedServices<T> (this IServiceProvider provider, object? serviceKey);
static member GetKeyedServices : IServiceProvider * obj -> seq<'T>
<Extension()>
Public Function GetKeyedServices(Of T) (provider As IServiceProvider, serviceKey As Object) As IEnumerable(Of T)

類型參數

T

要取得之服務物件的類型。

參數

provider
IServiceProvider

要從其中擷取服務的 IServiceProvider

serviceKey
Object

物件,指定要取得之服務物件的索引鍵。

傳回

類型 T 服務的列舉。

適用於