I wrote an asp.net website.
I have a BLL project (meaning dll type project)
in which I want to save some data to be static for the session.
how can I do so? If i’ll declare them static they will be static for the application.
Is there a way to avoid saving them in the asp.net session dictionary (I don’t want to burden the site, it’s in the BLL after all).
TIA
The session is the right place to store this data.
To use it within the BLL you can abstract from session and create a UserStore of some kind, that hides the implementation. This can be injected via DI, possibly using an IoC Container.
A more simple approach is to pass in a reference to the current HttpContext or session either when you contruct the BLL object, or call the method. Ideally you would use the abstractions library to keep it testable.