G
Guest
I have a dataset called Checklists created with the dataset designer giving
me Checklists.designer.cs It has a [Serializable()] attribute, i.e.,
[Serializable()]
public partial class Checklists {
....
}
In another file, ChecklistsExt.cs I have
public partial class Checklists{
public string var1;
protected decimal var2;
....
}
This is part of an ASP.NET app and I put an instance of Checklists in the
session data. I am using sqlserver as the state persistence manager.
When I attempt to retrieve the Checklists instance from the session data
after a round trip, all the tables etc that are managed by
Checklists.designer.cs are there, but the variables in "my" half of the
partial class have lost their value.
The designer generated code has a significant chunk of code in its
getObjectData() method and the deserialization protected constructor and that
is how it gets its stuff in and out of the serialized session data store.
I think that the problem is that if there was no custom serialization code,
normal .NET introspection would handle the whole thing for me. But that isn't
happening and I can't figure out the right way to hook into the designer's
de/serialization logic.
If I had created a derived class instead of using partial classes, I could
handle the problem easily by overriding the getObjectData and constructor
code, calling the base methods and then adding my own custom variable
management.
What's the right way to do this? A quick response would be VERY much
appreciated as it is holding up deployment at the client site.
Thx
Marc
me Checklists.designer.cs It has a [Serializable()] attribute, i.e.,
[Serializable()]
public partial class Checklists {
....
}
In another file, ChecklistsExt.cs I have
public partial class Checklists{
public string var1;
protected decimal var2;
....
}
This is part of an ASP.NET app and I put an instance of Checklists in the
session data. I am using sqlserver as the state persistence manager.
When I attempt to retrieve the Checklists instance from the session data
after a round trip, all the tables etc that are managed by
Checklists.designer.cs are there, but the variables in "my" half of the
partial class have lost their value.
The designer generated code has a significant chunk of code in its
getObjectData() method and the deserialization protected constructor and that
is how it gets its stuff in and out of the serialized session data store.
I think that the problem is that if there was no custom serialization code,
normal .NET introspection would handle the whole thing for me. But that isn't
happening and I can't figure out the right way to hook into the designer's
de/serialization logic.
If I had created a derived class instead of using partial classes, I could
handle the problem easily by overriding the getObjectData and constructor
code, calling the base methods and then adding my own custom variable
management.
What's the right way to do this? A quick response would be VERY much
appreciated as it is holding up deployment at the client site.
Thx
Marc