Open sandboxFocus

Method GetService

GetService<T>()

Resolves a service of type T by running its factory.

Declaration
public static T GetService<T>()
Returns
Type Description
T

The service returned by the factory, or the default value of T when no service of type T is registered.

Type Parameters
Name Description
T

The type of the service.

Exceptions
Type Condition
InvalidCastException

The factory returned an object that is not assignable to T.