Open sandboxFocus

Method GetService

GetService<T>(bool)

Gets a build-time service exposed by PostSharp.

Declaration
T GetService<T>(bool throwing = true) where T : class, IService
Parameters
Type Name Description
bool throwing

true whether an exception should be thrown in case the service cannot be acquired, otherwise false. The default value is true.

Returns
Type Description
T

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

Type Parameters
Name Description
T

An interface derived from IService.