Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use HttpContext.Current #2

Open
Alxandr opened this issue Jul 30, 2012 · 1 comment
Open

Don't use HttpContext.Current #2

Alxandr opened this issue Jul 30, 2012 · 1 comment

Comments

@Alxandr
Copy link

Alxandr commented Jul 30, 2012

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
Copy link
Author

Alxandr commented Jul 30, 2012

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant