I have a json response like
{
\"appStatus\":{
\"status\":true
},
\"lastSyncDate\":\"06-07-2013 13.54.27\",
\"configResponse\":{
\"status\":{
i have only use this method and it worked.
await JsonConvert.DeserializeObjectAsync<ConfigResponse>(jsontoobject, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
You can parse JSON string into JObject
, get sub-object "configResponse", then deserialize it into ConfigResponse
. It's one line of code:
JObject.Parse("{...}")["configResponse"].ToObject<ConfigResponse>()
If you need a custom serializer to set deserialization options, you can pass it to ToObject<T>()
method.