How Does Autofac Handle Non-Disposable Components

核能气质少年 提交于 2020-06-29 04:32:08

问题


I have read that Autofac does a good job of disposing IDisposable resources, but I'm having trouble finding any info on what it does with components that do not have any unmanaged resources, and therefore do not need to implement IDisposable. I would assume these all get garbage collected, but is there any documentation on this scenario?

EDIT

Asking more specifically, are all Autofac-resolved components required to implement IDisposable? The docs state that

To take advantage of automatic deterministic disposal, your component must implement IDisposable.

Am I correct in understanding this refers to any kind of Autofac-resolved component?


回答1:


There's petty good documentation from autofac on managing the disposal of the objects.

See: https://autofaccn.readthedocs.io/en/latest/lifetime/disposal.html



来源:https://stackoverflow.com/questions/60213990/how-does-autofac-handle-non-disposable-components

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!