HttpContext.Items with ASP.NET MVC

前端 未结 3 2020
独厮守ぢ
独厮守ぢ 2020-12-05 13:28

I\'m implimenting my own ApplicationContext class that uses the singleton pattern. I want to store my instance of it in HttpContext.Items, since it is accessible in all par

3条回答
  •  鱼传尺愫
    2020-12-05 13:55

    I did a test and TempData does, indeed, explode with session state disabled. My only advice would be to not store the object itself in temp data but store the simple typed fields as has been suggested. Since you're not serializing object trees it shouldn't be that big of a performance impact running out-of-process.

提交回复
热议问题