Class SingletonLifetimeManager
Singleton lifetime creates globally unique singleton. Any Unity container tree (parent and all the children) is guaranteed to have only one global singleton for the registered type.
Inheritance
Inherited Members
Namespace: Unity.Lifetime
Assembly: Unity.Abstractions.dll
Syntax
public class SingletonLifetimeManager : ContainerControlledLifetimeManager, IDisposable, IInstanceLifetimeManager, IFactoryLifetimeManager, ITypeLifetimeManager
Remarks
Registering a type with singleton lifetime always places the registration at the root of the container tree and makes it globally available for all the children of that container. It does not matter if registration takes places at the root of child container the destination is always the root node.
Repeating the registration on any of the child nodes with singleton lifetime will always override the root registration.
When the SingletonLifetimeManager is disposed, the instance it holds is disposed with it.
Methods
| Improve this Doc View SourceToString()
This method provides human readable representation of the lifetime
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | Name of the lifetime |