sergiosuperstar / PMF-WeeEee

Student project: daily planning
0 stars 0 forks source link

Investigate Dispose() method for Autofac MVC container #25

Closed bsogura closed 7 years ago

bsogura commented 7 years ago
alisamacos commented 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