ServiceProviderServiceExtensions.GetService(IServiceProvider) ServiceProviderServiceExtensions.GetService(IServiceProvider) ServiceProviderServiceExtensions.GetService(IServiceProvider) Method

Definition

Get service of type T from the IServiceProvider.

public static T GetService<T> (this IServiceProvider provider);
static member GetService : IServiceProvider -> 'T
<Extension()>
Public Function GetService(Of T) (provider As IServiceProvider) As T

Type Parameters

T

The type of service object to get.

Parameters

provider
IServiceProvider IServiceProvider IServiceProvider

The IServiceProvider to retrieve the service object from.

Returns

T T T

A service object of type T or null if there is no such service.

Applies to