Ninject on asp.net Session State

I am working with Ninject in a web application using BasePage and BaseMaster from framework integration. What I would like to do is index the object and create a new instance in every session. I looked at the behavior of OnePerRequest and it closed, but not quite. What I am doing is doing a lot of calculations, and those variables are stored in objects that are entered into the page. I want the objects to stay on the back, but I want a new instance of the objects every time the user "visits" the site. My initial thinking was to somehow use the Asp.net Session object to store the value between postbacks.This is how I would do it before Ninject (just save the objects in the session, but I would like to use Ninject correctly if I am open to other suggestions.I was thinking about using a Singleton, but each user will need their own copy of the object, otherwise they will step on each other's calculations.

I hope this is clear and I would appreciate any advice on using existing behavior or creating my own. Perhaps using the application cache or ASP.NET's built-in caching might work.

thank

Josh

0


source to share


1 answer


What you seem to be looking for is "OnePerSessionBehavior". I found another StackOverflow post to those who have already implemented this, maybe you can ask this user for the code:



+2


source







All Articles