Last active
February 5, 2019 10:52
-
-
Save AshV/1464f4855e8a7a2524431e00b284a0f8 to your computer and use it in GitHub Desktop.
Remove null properties while serializing JSON using Newtonsoft.Json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Newtonsoft.Json; | |
JsonConvert.SerializeObject( | |
<your Object to be serialized>, | |
Newtonsoft.Json.Formatting.None, | |
new JsonSerializerSettings | |
{ | |
NullValueHandling = NullValueHandling.Ignore | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment