ServiceHelperGetServiceT Method (IServiceProvider) |
Namespace:
AGI.Foundation.Infrastructure
Assembly:
AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 24.3.420.0 (24.3.420.0)
Syntax public static T GetService<T>(
IServiceProvider serviceProvider
)
where T : class
Public Shared Function GetService(Of T As Class) (
serviceProvider As IServiceProvider
) As T
public:
generic<typename T>
where T : ref class
static T GetService(
IServiceProvider^ serviceProvider
)
static member GetService :
serviceProvider : IServiceProvider -> 'T when 'T : not struct
Parameters
- serviceProvider
- Type: SystemIServiceProvider
The service provider from which to obtain the service.
Type Parameters
- T
- The type of service to obtain.
Return Value
Type:
TThe requested service.
Exceptions See Also