Skip to content

IMutableDependencyResolver interface

Defined in

Namespace: Splat Assembly: Splat.Core.dll Full name: Splat.IMutableDependencyResolver Modifiers: public abstract

Summary

        Represents a mutable dependency resolver that allows for the registration, unregistration, and querying of service
        factories and instances at runtime. Enables dynamic management of service lifetimes and contracts within a
        dependency injection system.
        

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481

Remarks

Implementations of this interface support advanced scenarios such as registering services with specific contracts, handling multiple registrations per service type, and reacting to service registration events via callbacks. This interface is typically used to extend or modify the set of available services during application execution, such as in plugin architectures or for testing purposes. Thread safety and registration order semantics may vary by implementation; consult the specific resolver's documentation for details.

Methods

NameSummary
HasRegistrationDetermines whether a registration exists for the specified service type.
RegisterRegisters a factory method for creating instances of the specified service type.
UnregisterCurrentUnregisters the current instance of the specified service type from the context.
UnregisterAllUnregisters all service registrations for the specified service type.
ServiceRegistrationCallbackRegisters a callback to be invoked when a service of the specified type is registered or becomes available.
RegisterConstantRegisters a constant value of the specified reference type for later retrieval or use.
RegisterLazySingletonRegisters a singleton service of type T that is created lazily using the specified factory function.

Extension members