I'm serializing this via System.Xml. I would like to have this type serialize as if I were serializing the wrapped
Value
Value
, rather than the whole type.
In other words, I want it to serialize as this:
2023-08-04 00:00:00
2023-08-04 00:00:00
rather than
<Value> 2023-08-04 00:00:00</Value>
<Value> 2023-08-04 00:00:00</Value>
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
JsonConverter
, but I'm not sure if System.Xml has a similar concept.