Method GetService
GetService<T>(IServiceProvider)
Gets a service from the service provider.
Declaration
public static T GetService<T>(this IServiceProvider serviceProvider) where T : class
Parameters
Type | Name | Description |
---|---|---|
IServiceProvider | serviceProvider | The service provider. |
Returns
Type | Description |
---|---|
T | The service. |
Type Parameters
Name | Description |
---|---|
T | The type of the service. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when |