How do you know the difference when an item in the json has the value null. Or if the value isn't at all in the json. Both will end up as null in the Entityobject. (made it up)
public class Entityobject
{
public Document document { get; set; }
public int randomint { get; set; }
public string randomstr{ get; set; }
}
Entityobject entity_obj= JsonConvert.DeserializeObject<Entityobject>(json);
so for example if the json is:
String json = "{
randomstr = null,
randomint = 1
}"
Now document will be null as well of course. But how do I know the difference? To clarify I can't set other values up front. And I actually prefer a better answer then: Just make another object which as other initial values then null. Also I still want to send null in the json. So I also can't send another value(like "delete" or so) and make it null afterwards. So to end the question: I want to know the difference between a null given in the json and a null which happens because it wasn't included in the json string.
Hopefully this is clear enough. Thank you in advance:)