0

In MVC3, I want to access the HttpContext from a Controller (not the HttpContextBase returned by the HttpContext property). Several articles (and StackOverflow answers) suggest using HttpContext.ApplicationInstance.Context. I've tried it, and it works, simple enough.

Can someone confirm that this property is unique per request and thread safe? Maybe it's just me, but I find the name ApplicationInstance confusing - it denotes an application-scope value (i.e., not unique per request).

Dale K
  • 25,246
  • 15
  • 42
  • 71

1 Answers1

1

I just did a quick google on HttpContext.ApplicationInstance.Context and found the following article at MSDN:

http://msdn.microsoft.com/en-us/library/system.web.httpcontext.applicationinstance.aspx

which states:

Gets or sets the HttpApplication object for the current HTTP request.

jgauffin
  • 99,844
  • 45
  • 235
  • 372