Skip to content

Month: December 2017

Owned<T> – Controlled Lifetime with Autofac

In general, Autofac controls the lifetime of components. It automatically disposes off all the disposable components at the end of lifetime scope. However, that may mean a component is held onto for too long. Generally speaking, an owned dependency corresponds to some unit of work performed by the dependent component.   Releasing an Owned<T> We use an owned¬†dependency when we want to control the disposal…