N
not_a_commie
DataContractSerializer.ReadObject creates an object without calling
any constructors. It doesn't require a parameterless constructor like
all other deserialization implementations I've ever seen or heard
about. That's just weird. How do they do it?
What's more weird, though, is that they don't initialize any fields.
That leads to strange bugs. Of course that's why they have the
OnDeserialized attribute -- you need to initialize your fields in that
method in addition to elsewhere in the class.
any constructors. It doesn't require a parameterless constructor like
all other deserialization implementations I've ever seen or heard
about. That's just weird. How do they do it?
What's more weird, though, is that they don't initialize any fields.
That leads to strange bugs. Of course that's why they have the
OnDeserialized attribute -- you need to initialize your fields in that
method in addition to elsewhere in the class.