Custom type serializer for Json.Net

烂漫一生 提交于 2019-12-13 20:22:33

问题


I'm using NewtonSoft Json.Net to serialize my objects to JSON. On of my classes is not serializing correctly. I was wondering if it is possible to build a custom type serializer that will output different JSON.

How can I make a custom serializer/deserializer for a specific class?


回答1:


you may create your own Custom JsonConverter and implement its ReadJson and WriteJson methods.



来源:https://stackoverflow.com/questions/20140472/custom-type-serializer-for-json-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!