每個請求是一個Scope
為什麼不能直接從Root Scope中Resolve例項,會造成記憶體洩漏,原因是Root Scope不會Dispose,長命持有短命問題
注意CreateScope() Scope的範圍
Ref
https://andrewlock.net/the-dangers-and-gotchas-of-using-scoped-services-when-configuring-options-in-asp-net-core/
https://blog.ploeh.dk/2014/06/02/captive-dependency/