Convenience generic extension method that calls GetService(Type) and casts the result.
Namespace: Spotfire.Dxp.Framework.Services
Assembly: Spotfire.Dxp.Framework (in Spotfire.Dxp.Framework.dll) Version: 25.11.10401.3615 (25.11.10401.3615)
Syntax
C#
public static TService GetService<TService>( this IServiceProvider provider ) where TService : class
Parameters
- provider
- Type: SystemIServiceProvider
The service provider instance.
Type Parameters
- TService
- The type of service object to get.
Return Value
Type: TServiceA service object of type TService -or- null if there is no service object of type TService.
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).Version Information
See Also