Doc Link: dotnet DI link
I have done the Tutorial step by step, but I fond a problem: Why scoped service disposed earlier than transient service in dotnet?
Scope 1... ScopedDisposable.Dispose() TransientDisposable.Dispose() Scope 2... ScopedDisposable.Dispose() TransientDisposable.Dispose() Addtional, I have found another discription on preceding DOC links. At section "IDisposable guidance for Transient and shared instances"
There is a more confused description:
https://stackoverflow.com/questions/67213913/why-scoped-service-disposed-earlier-than-transient-service-in-dotnet April 22, 2021 at 09:07PMThe instance should be disposed before the scope ends.
没有评论:
发表评论