问题
I'm using Newtonsoft.Json to turn json into objects, that works fine. I was wondering if there's a nice way to reverse the process noting that i dont want to jsonise all the object fields. To paraphrase, is there a way to use Newtonsoft.Json to produce thinned down jsonised object representations?
回答1:
Have you tried using the JsonIgnore to opt-out properties that you don't want to be included in the JSON serialization? See this topic:
http://james.newtonking.com/projects/json/help/ReducingSerializedJSONSize.html
来源:https://stackoverflow.com/questions/6746770/an-easy-way-to-serialise-c-sharp-objects