I am working on writing a web api for my application, which is currently written using ASP.NET web forms. I have a module that receives some data at the beginning of the request and stores it in HttpContext.Current.Items so that it is available to all code later during page processing.
I am trying to write my web api and it should do the same. What is the correct way to store global “on request” data that will be used during processing for the api web controller (I suspect this will be the same for a regular controller).
Also, if there is a way to do this, is there a way to set this data in the IHttpModule module, which runs before the controller is instantiated.
Any help is appreciated!
source share