'Declaration
<ExtensionAttribute()> <CanBeNullAttribute()> Public Shared Function GetService(Of TService As Class)( _ ByVal serviceProvider As IServiceProvider _ ) As TService
'Usage
Dim serviceProvider As IServiceProvider Dim value As TService value = IServiceProviderExtension.GetService(Of TService)(serviceProvider)
[Extension()] [CanBeNull()] public static TService GetService<TService>( IServiceProvider serviceProvider ) where TService: class
[Extension()] [CanBeNull()] public: static TService^ GetServicegeneric<typename TService> ( IServiceProvider^ serviceProvider ) where TService: ref class
Parameters
- serviceProvider
- The service provider.
Type Parameters
- TService
- The type of service object to get.
Return Value
A service object of type TService.