I have a custom class that is an entire structure within itself, many layers deep. However, this object is stored in memory through sessions. I need a way to retrieve the session variable without having to call it through a return method. An Example:
This is what I currently have to do:
ClassName variable = new ClassName().GetSessionObject();
variable.MethodCall();
I want to be able to cast it just like this, and retrieve it from the session at the same time:
ClassName variable = new ClassName();
variable.MethodCall();
I am not sure how to do this since I cannot return something from a constructor, and I cannot assign something to the class with the "this" keyword, or alike.
Thank you.