ServiceProviderExtensionsGetServiceT Method |
[This is preliminary documentation and is subject to change.]
Retrieves a service from the serviceProvider
Namespace:
CSInfrastructure.Extensions
Assembly:
CSInfrastructure (in CSInfrastructure.dll) Version: 1.13.0+Branch.master.Sha.d583fc64569355d188a9c0818d257b6d0d3e1339
Syntax public static T GetService<T>(
this IServiceProvider serviceProvider
)
Parameters
- serviceProvider
- Type: SystemIServiceProvider
The service provider to retrieve the service from
Type Parameters
- T
- The type of service to retrieve
Return Value
Type:
TAn instance of the requested service type, if it's registered with the service provider
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IServiceProvider. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also