它们之间有什么区别? InRequestScope依赖于HttpContext.Current,它仅可从请求线程使用,因此它与InThreadScope不同吗?
InRequestScope
HttpContext.Current
InThreadScope
如果您希望对象在HttpRequest上下文中存在时声明了绑定InThreadScope,则会遇到很多问题:
您不应该在HttpRequest的上下文中使用InThreadScope,因为您不应该在同一上下文中使用ThreadStatic属性
ThreadStatic