您的位置:首页 > 运维架构

DI中Transient Scoped Singleton Instance的区别

2016-07-15 16:33 183 查看




Observe which of the
OperationId
values varies within a request, and between requests.

Transient
objects are always different; a new instance is provided to every controller and every service.

Scoped
objects are the same within a request, but different across different requests

Singleton
objects are the same for every object and every request (regardless of whether an instance is provided in
ConfigureServices
)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: