I have an object tree that I\'m serializing to JSON with DataContractJsonSerializer
. Dictionary
gets serialized but I don\'t li
Seems, there is no way to customize DataContractJsonSerializer.
If you still want to achieve what you want, consider using Json.Net. It's faster and more flexible than DataContractJsonSerializer. Look at JsonConverter conception of Json.Net. It gives you the possibility to customize serialization/deserialization process.
Moreover default implementation of dictionary serialization is exact as you want http://james.newtonking.com/projects/json/help/SerializingCollections.html.