I'm developing SVC services and a class library in .Net 4.5.
First of all, all the services are receiving some headers to check the user.
WebOperationContext woCtx
string token = woCtx.IncomingRequest.Headers["token"];
// check the token via WS and return a response containing some info
After this check I get user's info like the Culture. The culture is used in many methods in the library. Now I have two solutions:
I can pass the culture as a parameter in every method.
Set
Thread.CurrentThread.CurrentUICulture
and use it
I'd know if class library is thread safe or different requests done by different users will be overwritten. Moreove I don't like to use Threads
in a class library.
I have already excluded to use a static property of a static class for the same reason.