container icon indicating copy to clipboard operation
container copied to clipboard

ILifetimeContainer interface is deprecated

Open ENikS opened this issue 6 years ago • 0 comments

Deprecating ILifetimeContainer interface

Lifetime container holds references to disposable instances that container created or registered. It is responsible for properly disposing these objects once container goes out of scope. The ILifetimeContainer interface is a facade for that container.

Problem

  • ILifetimeContainer operates on objects instead of IDisposable. It is possible to add an object that is not IDisposable
  • The interface does not provide any custom functionality beyond simple ICollection
  • This property references owner container and could be used to resolve dependencies inside GetValue/SetValue handlers.

Solution

This interface should be removed and replaced with simple ICollection<IDisposable>. These are member to member compatible.

ENikS avatar Jun 28 '20 01:06 ENikS