I have an object like this:
class MyObject { public string Object.Prop1 { get; set; } public string Object.Prop2 { get; set; } }
I am writing a custom JSON converter, and I serialize this object as follows:
Dictionary<string, object> OutputJson = new Dictionary<string, object>(); OutputJson.Add("TheProp1", MyObject.Prop1.Trim());
If for some reason Prop1
is null
, will Prop1
be encoded as ""
or will it crash?
source share