Is implementing ISerializable interface necessary when not implementing any custom serialization/deserialization

后端 未结 6 1646
花落未央
花落未央 2021-01-11 10:45

I am looking at a class in a solution that implements the ISerializable interface. It has a GetObjectData method for serialization as required by t

6条回答
  •  没有蜡笔的小新
    2021-01-11 11:16

    You might as well always implment ISerializable. Yeah, it can be a lot of typing if you have a lot of objects, but the deserializer will break if you later introduce it. I think it is better for versioning objects instead of writing new ones and keeping old ones.

提交回复
热议问题