Table of Contents

Class ContainerControlledTransientManager

Namespace
Unity.Lifetime
Assembly
Unity.Abstractions.dll

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.

public class ContainerControlledTransientManager : LifetimeManager, IFactoryLifetimeManager, ITypeLifetimeManager
Inheritance
ContainerControlledTransientManager
Implements
Inherited Members
Extension Methods

Properties

InUse

A bool indicating if this manager is being used in one of the registrations.

public override bool InUse { get; set; }

Property Value

bool

True is this instance already in use, False otherwise.

Remarks

The Unity container requires that each registration used its own, unique lifetime manager. This property is being used to track that condition.

Methods

OnCreateLifetimeManager()

Implementation of CreateLifetimePolicy() policy.

protected override LifetimeManager OnCreateLifetimeManager()

Returns

LifetimeManager

A new instance of the same lifetime manager of appropriate type

SetValue(object, ILifetimeContainer)

Stores the given value into backing store for retrieval later.

public override void SetValue(object newValue, ILifetimeContainer container = null)

Parameters

newValue object

The object being stored.

container ILifetimeContainer

The container this lifetime is associated with

ToString()

This method provides human readable representation of the lifetime

public override string ToString()

Returns

string

Name of the lifetime