J
jehugaleahsa
I have a base class for all of my data objects, called DataObject.
The DataObject class has no fields, just methods.
I have serializable derived classes, like Customer, that is looks like
this:
[Serializable]
public class Customer : DataObject
{
/* Uses default ctor */
}
However, every time I try to serialize, I get an exception saying that
DataObject can't be serialized.
I marked it with the Serializable attribute but to no affect.
It looks like .NET wants me to implement ISerializable. But if I do
that, each of my derived classes has to do a lot more work (like
provide a new constructor).
Is there a way to make this work without altering every one of my
derived classes?
The DataObject class has no fields, just methods.
I have serializable derived classes, like Customer, that is looks like
this:
[Serializable]
public class Customer : DataObject
{
/* Uses default ctor */
}
However, every time I try to serialize, I get an exception saying that
DataObject can't be serialized.
I marked it with the Serializable attribute but to no affect.
It looks like .NET wants me to implement ISerializable. But if I do
that, each of my derived classes has to do a lot more work (like
provide a new constructor).
Is there a way to make this work without altering every one of my
derived classes?