
正文
DI中Transient Scoped Singleton Instance的区别
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
Observe which of the
OperationId
values varies within a request, and between requests.
-
Transientobjects are always different; a new instance is provided to every controller and every service. -
Scopedobjects are the same within a request, but different across different requests -
Singletonobjects are the same for every object and every request (regardless of whether an instance is provided inConfigureServices)







