Dan Coupar

Dan Coupar

  • NA
  • 5
  • 5k

Caching data for lifetime of thread

May 21 2013 3:45 PM
Hi folks,

I'm looking for a way of caching data for the lifetime of a thread. The data doesn't need to be accessible across threads. In ASP.NET, you can do this using the HttpContext.Current.Items collection. Anything you store in here is retained as long as the thread is alive, and is accessible from any class. I was wondering if there's a more generic equivalent in the .NET framework (4.0) which isn't tied to HTTP.

Thanks,
Dan.

Answers (4)