PostSharp 6.6 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Utilities Namespace / Service­Locator Class / Service­Locator Methods / Service­Locator.​Get­Service(T) Method

ServiceLocator.GetService<T> Method

Gets a service implementation.

Namespace:  PostSharp.Patterns.Utilities
Assembly:  PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 6.6.14.0 (6.6.14.0)
Syntax
C#
public static T GetService<T>()
where T : class

Type Parameters

T
Type of the requested service interface.

Return Value

Type: T
An implementation of T, or null if no such service has been registered.
See Also