Class ServiceRegistryExtensions
public static class ServiceRegistryExtensions
- Inheritance
-
ServiceRegistryExtensions
Methods
GetSafeServiceAs<T>(IServiceRegistry)
Gets a service instance from a specified interface contract.
public static T GetSafeServiceAs<T>(this IServiceRegistry registry) where T : class
Parameters
registry
IServiceRegistryThe registry.
Returns
- T
An instance of the requested service registered to this registry.
Type Parameters
T
Type of the interface contract of the service
Exceptions
- ServiceNotFoundException
If the service was not found
GetServiceLate<T>(IServiceRegistry, Action<T>)
Gets a service instance from a specified interface contract.
public static void GetServiceLate<T>(this IServiceRegistry registry, Action<T> serviceReady) where T : class
Parameters
registry
IServiceRegistryThe registry.
serviceReady
Action<T>The service ready.
Type Parameters
T
Type of the interface contract of the service
Exceptions
- ServiceNotFoundException
If the service was not found