Class ServiceLocatorBridge
Static access bridge for the IServiceLocator instance.
Inherited Members
Namespace: Serenity.Global.Application.Services
Assembly: Serenity.Global.Application.dll
Syntax
public static class ServiceLocatorBridge
Remarks
Used by Unity-side components that cannot receive IServiceLocator via constructor injection, such as EventDispatcher actions instantiated via reflection. This bridge must be initialized during the installation flow via SetStatic(IServiceLocator).
Methods
ClearStatic()
Clears the current service locator instance.
Declaration
public static void ClearStatic()
SetStatic(IServiceLocator)
Sets the service locator instance.
Declaration
public static void SetStatic(IServiceLocator serviceLocator)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceLocator | serviceLocator | The service locator to set. |
TryGetStatic(out IServiceLocator)
Attempts to retrieve the current service locator.
Declaration
public static bool TryGetStatic(out IServiceLocator serviceLocator)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceLocator | serviceLocator | The service locator if available, null otherwise. |
Returns
| Type | Description |
|---|---|
| bool | True if a service locator is available, false otherwise. |