logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class ServiceLocatorBridge

    Static access bridge for the IServiceLocator instance.

    Inheritance
    object
    ServiceLocatorBridge
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    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.

    In this article
    © 2026 Serenity. All Rights Reserved