I want to store some info (key value pair) in a c# thread context or similar ( just like httpcontext for a web request ).
I want to be able to store this info (key value pair) somewhere in thread context ( or something similar) so that my code can always read these values from the current thread its running under.
In my appliation i have a chain of API calls and its not possible to pass this info from one method to other ( already dsicarded this option! )
note – this thread is running as an async operation inside an Asp.Net application.
Are you looking for Thread Local storage using the ThreadStatic attribute ?
Of course you could add some helper methods or properties to the above to help you manage the instance, including ensuring initialization on each thread.