Closed bsogura closed 7 years ago
To take advantage of automatic deterministic disposal, component must implement IDisposable. You can then register your component as needed and at the end of each lifetime scope in which the component is resolved, the Dispose() method on the component will be called.
If your component doesn’t implement IDisposable but still requires some cleanup at the end of a lifetime scope, you can use the OnRelease lifetime event.
Resource: http://docs.autofac.org/en/latest/lifetime/disposal.html#automatic-disposal