I’m switching from InProc session to SQL server session. Currently, my session object looks like this:
public class UserSession{
public string TheStrings {get;set;}
public int TheInts {get;set;}
public List<MyObjectModel> ListOfObjects {get;set;}
}
It basically holds strings, ints and several lists of objects. What I do is store this object in the session and then when I need to access the session, I can write UserSession.TheStrings.
Now that I’m cconverting this to SQL session, serialization comes in play. Do I need to add the [serializable] attribute only to the entire class or do I also need to add it to the class definition of all the MyObjectModels as well?
Thanks.
I am pretty sure it will serialize by default as long as everything in your objects are simple types.
SerializableAttribute Class