I have some data that is persisted in a database. The serialized content was originally written using the default NetDataContractSerializer
with a DataContract
attribute on the classes.
Now I want to move to using classes that implement IXmlSerializable
to have more control over the serialized content and make it leaner and faster.
How will I be able to read the current content as well as store future content in the new way.
I have looked into ISurrogateSelector
, but it doesn't seem to do the trick as the ISerializationSurrogate
interface only supports getting and setting object data as the ISerializable
interface, but no way to specify ReadXml
and WriteXml
as in IXmlSerializable
interface. As I am reading in the stream, I don't have any information about the format other than the stream itself.
The deserialization must produce the same class instance regardless of the original serialization method.
I need to make a solution that uses .NET Framework 4.6
Asked
Active
Viewed 33 times
1

4thex
- 1,094
- 1
- 9
- 21