PostSharp6.0/API Reference/Post­Sharp.​Extensibility Namespace/IProject Interface/IProject Methods/IProject.​Get­Service(T) Method

IProject.GetService<T> Method

Gets a build-time service exposed by PostSharp.

Namespace:  PostSharp.Extensibility
Assembly:  PostSharp (in PostSharp.dll) Version: 6.1.6.0 (6.1.6.0)
Syntax
C#
T GetService<T>(
	bool throwing = true
)
where T : class, IService

Parameters

throwing (Optional)
Type: System.Boolean
true whether an exception should be thrown in case the service cannot be acquired, otherwise false. The default value is true.

Type Parameters

T
An interface derived from IService.

Return Value

Type: T
The service T, or null if the service could not be acquired and throwing was set to false.

Implements

IServiceLocator.GetService<T>(Boolean)
See Also