Reputation: 33
I am playing around with the ASP.NET vNext. and I was wondering how to create my own context per request.
In older versions I would create a singleton and store it in HttpContext.Current.Items
.
The idea is that I want to load some data at the beginning of the request that should be available through the entire request.
Upvotes: 3
Views: 1268
Reputation: 58434
You can achieve the same with HttpContext Items. You would write a middleware like this one and you can handle your stuff inside the Invoke method.
Upvotes: 1