ServiceProviderServiceExtensions.GetServices Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
GetServices(IServiceProvider, Type) |
Get an enumeration of services of type |
GetServices<T>(IServiceProvider) |
Get an enumeration of services of type |
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
.NET 10 (package-provided) dan versi lain
Produk | Versi |
---|---|
.NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.NET Standard | 2.0 (package-provided), 2.1 (package-provided) |
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
.NET 10 (package-provided) dan versi lain
Produk | Versi |
---|---|
.NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.NET Standard | 2.0 (package-provided), 2.1 (package-provided) |
.NET maklum balas
.NET ialah projek sumber terbuka. Pilih pautan untuk memberikan maklum balas: