แชร์ผ่าน


ServiceProviderServiceExtensions.GetServices Method

Definition

Overloads

GetServices(IServiceProvider, Type)

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

GetServices<T>(IServiceProvider)

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

GetServices(IServiceProvider, Type)

Source:
ServiceProviderServiceExtensions.cs
Source:
ServiceProviderServiceExtensions.cs
Source:
ServiceProviderServiceExtensions.cs

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

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

Returns

An enumeration of services of type serviceType.

Applies to

GetServices<T>(IServiceProvider)

Source:
ServiceProviderServiceExtensions.cs
Source:
ServiceProviderServiceExtensions.cs
Source:
ServiceProviderServiceExtensions.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> ^ GetServices(IServiceProvider ^ provider);
public static System.Collections.Generic.IEnumerable<T> GetServices<T> (this IServiceProvider provider);
static member GetServices : IServiceProvider -> seq<'T>
<Extension()>
Public Function GetServices(Of T) (provider As IServiceProvider) As IEnumerable(Of T)

Type Parameters

T

The type of service object to get.

Parameters

provider
IServiceProvider

The IServiceProvider to retrieve the services from.

Returns

An enumeration of services of type T.

Applies to