Interface ILifetimeContainer
Represents a lifetime container.
public interface ILifetimeContainer : IEnumerable<object>, IEnumerable, IDisposable
- Inherited Members
- Extension Methods
Remarks
A lifetime container tracks the lifetime of an object, and implements IDisposable. When the container is disposed, any objects in the container which implement IDisposable are also disposed.
Properties
Container
The container that this context is associated with.
IUnityContainer Container { get; }
Property Value
- IUnityContainer
The IUnityContainer object.
Count
Gets the number of references in the lifetime container
int Count { get; }
Property Value
- int
The number of references in the lifetime container
Methods
Add(object)
Adds an object to the lifetime container.
void Add(object item)
Parameters
item
objectThe item to be added to the lifetime container.
Contains(object)
Determine if a given object is in the lifetime container.
bool Contains(object item)
Parameters
item
objectThe item to locate in the lifetime container.
Returns
- bool
Returns true if the object is contained in the lifetime container; returns false otherwise.
Remove(object)
Removes an item from the lifetime container. The item is not disposed.
void Remove(object item)
Parameters
item
objectThe item to be removed.