Is it possible in ASP.NET Core to bind an instance of a C# class to a session?
So that the class lifetime is also tied to the session lifetime ~20 minutes.
I want to store somewhere the values entered by the user in a web form so that the values are saved when the user hits browser refresh or leaves the page for a short time.
Like this:
HttpContext.Session.RegisterClass(MySessionDataClass);
...
HttpContext.Session.GetObjectValue(MySessionDataClass);
// Create new MySessionDataClass or return an
// instance of a class that has already been created for this session.