JObject.Parse vs JsonConvert.DeserializeObject

62 Points
26 Posts


I am working around json parsing. There is two techniques available to parse a json string/object in NewtonSoft package

  • Newtonsoft.Json.Linq.JObject
  • Newtonsoft.Json.JsonConvert.DeserializeObject

what is different between these and when we can use it?

Views: 8551
Total Answered: 1
Total Marked As Answer: 1
Posted On: 10-Mar-2016 08:02

Share:   fb twitter linkedin
Rahul Maurya
Rahul M...
1172 Points
211 Posts

Hi Priya,

The LINQ-to-JSON API (JObject, JToken, JArray etc.) is to allow working with JSON without need to know its structure. You can deserialize any arbitrary JSON using JToken.Parse, JObject.Parse, JArray.Parse then examine and manipulate its contents using other methods. LINQ-to-JSON also works well if you just need one or two or more values from the JSON (such as the name of a county).

JsonConvert.DeserializeObject, on the other hand, is mainly intended to be used when you know the structure of the JSON and you want to deserialize into strongly typed classes.

Posted On: 25-Mar-2016 01:17
 Log In to Chat