My businesslayer\data access library is being used by both a web application and a wcf service. I need to set the current user context on each request for both of these application which would contain userid, Ip, application type etc etc.
The library is obviously not aware what type of application is using it.
Now i cant keep this information in a static variable since subsequent requests would override older values. And I dont want to pass this variable into each and every class where it might be needed like the logging component.
This might be a dumb question but is there a way to create a thread level static variable like the OperationContext.Current or the HttpContext.Current (Something that will be gone at the end of the current request)
Or some other way that I might be able to achieve this functionality?