更新时间:2022-12-11 11:39:00
远离ASP.NET中的ThreadStaticAttribute-唯一正确的方法是将内容放入HttpContext.Items
中,但是在此之前总是有许多更好的方法可以尝试你去
像这样低级的东西.
Stay well away from ThreadStaticAttribute in ASP.NET - the only correct way is to put stuff in HttpContext.Items
, but there always many better approaches to be tried before you go to
something low level like that.
这里的关键问题是您在一个错误的假设下工作-模型绑定程序在请求之间共享.
Key problem here is that you are working with a bad assumption - model binders are shared between requests.