This article is a mirror article of machine translation, please click here to jump to the original article.

View: 22962|Reply: 1

[Source] Newtonsoft.Json ignores null values

[Copy link]
Posted on 6/7/2016 3:15:17 PM | | | |





Above, this is the entity class I defined, and I only assign a value to name




Then, I serialize to strings by default and get something like this:

---------------------------

---------------------------
{"name":"test","var":null,"var1":null,"var2":null,"var3":null}
---------------------------
OK   
---------------------------


How to remove those unused fields????








Previous:[Alibaba Green Network] intelligent pornography detection tool, intelligent identification of pornographic images
Next:Alibaba hinted at the solution to the Discuz memcache+ssrf GETSHELL vulnerability
 Landlord| Posted on 7/12/2016 12:05:05 PM |
Shorthand form


Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com