Class PerResolveLifetimeManager
This is a custom lifetime manager that acts like TransientLifetimeManager, but also provides a signal to the default build plan, marking the type so that instances are reused across the build up object graph.
Inherited Members
Namespace: Unity.Lifetime
Assembly: Unity.Abstractions.dll
Syntax
public class PerResolveLifetimeManager : LifetimeManager, IInstanceLifetimeManager, IFactoryLifetimeManager, ITypeLifetimeManager
Fields
| Improve this Doc View Sourcevalue
Declaration
protected object value
Field Value
| Type | Description |
|---|---|
| Object |
Methods
| Improve this Doc View SourceGetValue(ILifetimeContainer)
Retrieves a value from the backing store associated with this Lifetime policy.
Declaration
public override object GetValue(ILifetimeContainer container = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ILifetimeContainer | container | The container this lifetime is associated with |
Returns
| Type | Description |
|---|---|
| Object | the object desired, or null if no such object is currently stored. |
Overrides
| 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 SourceToString()
This method provides human readable representation of the lifetime
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| String | Name of the lifetime |