In newtonsoft json.net when we use
JsonConvert.SerializeObject(null, Formatting.Indented)
I get "null"
in the output as expected.
Now, I would like to represent objects (which can be null) with a JObject, but it throws an exception when I try to encode null this way:
(JObject.FromObject(null)).ToString(Formatting.Indented)
Is there a way to do this? Thanks