Class ContainerControlledTransientManager
A special lifetime manager which works like TransientLifetimeManager, except container remembers all Disposable objects it created. Once container is disposed all these objects are disposed as well.
Inherited Members
Namespace: Unity.Lifetime
Assembly: Unity.Abstractions.dll
Syntax
public class ContainerControlledTransientManager : LifetimeManager, IFactoryLifetimeManager, ITypeLifetimeManager
Properties
| Improve this Doc View SourceInUse
A Boolean indicating if this manager is being used in one of the registrations.
Declaration
public override bool InUse { get; set; }
Property Value
Type | Description |
---|---|
Boolean | True is this instance already in use, False otherwise. |
Overrides
Remarks
The Unity container requires that each registration used its own, unique lifetime manager. This property is being used to track that condition.
Methods
| Improve this Doc View SourceOnCreateLifetimeManager()
Implementation of CreateLifetimePolicy() policy.
Declaration
protected override LifetimeManager OnCreateLifetimeManager()
Returns
Type | Description |
---|---|
LifetimeManager | A new instance of the same lifetime manager of appropriate type |
Overrides
| Improve this Doc View SourceSetValue(Object, ILifetimeContainer)
Stores the given value into backing store for retrieval later.
Declaration
public override void SetValue(object newValue, ILifetimeContainer container = null)
Parameters
Type | Name | Description |
---|---|---|
Object | newValue | The object being stored. |
ILifetimeContainer | container | The container this lifetime is associated with |
Overrides
| 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 |