I have a static class containing my database logic.
This class is used on a website, web services, and as part of a middleware component.
For each method in this class, I need a piece of contextual information from the caller. In the case of a website, this will be user information, for the web service and middleware component, this identifies the calling service.
I cannot save this value in the configuration, because it can be different for each user, and I do not always have httpcontext to get this.
I could easily add a new parameter for each method in this class, or I could change it from a static class so that it has one non-static property, but none of these solutions seem very elegant.
So, are there any other options that I have not considered?
source
share