HttpContext.Current.Items in different thread

后端 未结 1 1217
鱼传尺愫
鱼传尺愫 2021-01-21 13:30

Using HttpContext.Current.Items we can access variables from current request

My question is what if the request moves to different thread, can we still access this ?

1条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-21 14:32

    You can always access HttpContext.Current.Itemsfrom the current request, no matter which thread ASP.Net decides to run the request on.

    If you're specifically asking about behavior with async actions, the ASP.Net runtime will handle all threading issues transparently for you. For more information on that topic, I suggest

    http://www.asp.net/mvc/tutorials/mvc-4/using-asynchronous-methods-in-aspnet-mvc-4

    0 讨论(0)
提交回复
热议问题