SimpleServiceLocator
A service locator designed for the common use case of managing lazy, class-keyed singletons.
This class allows services to be registered and retrieved using their class type as an identifier, providing a straightforward way to manage application-wide dependencies.
Parameters
The type of the scope identifier.
The specific scope instance for this locator.
if true, allow registering keys multiple times. The latest registration will be used. This should generally only be true for tests.
Properties
The default LazyThreadSafetyMode used for lazy-initialized dependencies managed by this service locator.
Functions
Fetches the singleton instance for the reified type T.
Fetches the singleton instance for the given class key.
Registers a lazy singleton provider for the reified type T.
Registers a lazy singleton provider for the given class key.