✅ Configure Xml Serialization
Hey folks! I have a type like this:
I'm serializing this via System.Xml. I would like to have this type serialize as if I were serializing the wrapped
In other words, I want it to serialize as this:
rather than
What are my options to make this happen? I would ideally like to avoid changing the serializer itself, but rather use an approach that the serializer will respect. For example, newtonsoft json uses
I'm serializing this via System.Xml. I would like to have this type serialize as if I were serializing the wrapped
Value, rather than the whole type.In other words, I want it to serialize as this:
rather than
What are my options to make this happen? I would ideally like to avoid changing the serializer itself, but rather use an approach that the serializer will respect. For example, newtonsoft json uses
JsonConverter, but I'm not sure if System.Xml has a similar concept.