ServiceProviderKeyedServiceExtensions.GetKeyedServices 方法

定义

重载

GetKeyedServices(IServiceProvider, Type, Object)

IServiceProvider获取 类型的serviceType服务的枚举。

GetKeyedServices<T>(IServiceProvider, Object)

IServiceProvider获取 类型的T服务的枚举。

GetKeyedServices(IServiceProvider, Type, Object)

Source:
ServiceProviderKeyedServiceExtensions.cs
Source:
ServiceProviderKeyedServiceExtensions.cs
Source:
ServiceProviderKeyedServiceExtensions.cs
Source:
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)

Source:
ServiceProviderKeyedServiceExtensions.cs
Source:
ServiceProviderKeyedServiceExtensions.cs
Source:
ServiceProviderKeyedServiceExtensions.cs
Source:
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 类型服务的枚举。

适用于