I want to find an equivalent to the HttpContext.Application Property but using OWIN. I'm not looking for the equivalent of HttpContext in OWIN because I already know what is it, I need to know what's the exactly equivalent of the Application property.
What I want to do is to create an object at the startup, use it on some request to Web API without recreating the object again so I want to have it in memory.
I'm using: - .Net 4.5 - ASP.NET Web API 2.2 - Microsoft.Owin.Host.SystemWeb 3.0.1
I've searched on Google and StackOverflow and found that I should use the CreatePerOwinContext
method but I don't know how to get the value I set into the context when I get requests from the clients on Web API.
In the old ASP.NET host I used to use this:
var myVariable = HttpContext.Application["MyVariable"]