DotNetOpenAuth.WebAPI icon indicating copy to clipboard operation
DotNetOpenAuth.WebAPI copied to clipboard

Don't use HttpContext.Current

Open Alxandr opened this issue 12 years ago • 1 comments

Using HttpContext.Current is gennerally considered a bad thing for several reasons like mocking and testability.

The following has proven to be working as an alternative: https://gist.github.com/3194281

Alxandr avatar Jul 30 '12 11:07 Alxandr

Oh, and I'd just like to add that using ThreadStatic values/properties (HttpContext.Current) in a async context sounds risky at best, though I'm also guessing that the CLR team has thought of this, and it might just work just as you'd expect it to. Something about async not necessarily meaning parallel...

Alxandr avatar Jul 30 '12 15:07 Alxandr