แชร์ผ่าน


ServiceProviderKeyedServiceExtensions.GetKeyedServices Method

Definition

Overloads

GetKeyedServices(IServiceProvider, Type, Object)

Get an enumeration of services of type serviceType from the IServiceProvider.

GetKeyedServices<T>(IServiceProvider, Object)

Get an enumeration of services of type T from the IServiceProvider.

GetKeyedServices(IServiceProvider, Type, Object)

Source:
ServiceProviderKeyedServiceExtensions.cs
Source:
ServiceProviderKeyedServiceExtensions.cs
Source:
ServiceProviderKeyedServiceExtensions.cs

Get an enumeration of services of type serviceType from the IServiceProvider.

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)

Parameters

provider
IServiceProvider

The IServiceProvider to retrieve the services from.

serviceType
Type

An object that specifies the type of service object to get.

serviceKey
Object

An object that specifies the key of service object to get.

Returns

An enumeration of services of type serviceType.

Applies to

GetKeyedServices<T>(IServiceProvider, Object)

Source:
ServiceProviderKeyedServiceExtensions.cs
Source:
ServiceProviderKeyedServiceExtensions.cs
Source:
ServiceProviderKeyedServiceExtensions.cs

Get an enumeration of services of type T from the IServiceProvider.

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)

Type Parameters

T

The type of service object to get.

Parameters

provider
IServiceProvider

The IServiceProvider to retrieve the services from.

serviceKey
Object

An object that specifies the key of service object to get.

Returns

An enumeration of services of type T.

Applies to