ServiceProviderServiceExtensions.GetServices Method
Definition
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.
Overloads
| GetServices(IServiceProvider, Type) |
Get an enumeration of services of type |
| GetServices<T>(IServiceProvider) |
Get an enumeration of services of type |
GetServices(IServiceProvider, 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);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("The native code for an IEnumerable<serviceType> might not be available at runtime.")]
public static System.Collections.Generic.IEnumerable<object?> GetServices(this IServiceProvider provider, Type serviceType);
public static System.Collections.Generic.IEnumerable<object?> GetServices(this IServiceProvider provider, Type serviceType);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("The native code for an IEnumerable<serviceType> might not be available at runtime.")>]
static member GetServices : IServiceProvider * Type -> seq<obj>
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.
- Attributes
Applies to
GetServices<T>(IServiceProvider)
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.