Difference between HttpContext.Current and Controller.Context in MVC ASP.NET

后端 未结 2 1436
南笙
南笙 2020-12-07 14:40

I am working on an MVC ASP .NET application. I am relatively new to both.

In a controller I am trying to get the current log on user, for which there seem to be two

2条回答
  •  自闭症患者
    2020-12-07 15:08

    Yes, they will usually be identical. However, if you're working with additional threads, they will not be; System.Web.HttpContext.Current is threadstatic.

提交回复
热议问题