parse json to c# class code example
Example 1: string to json c#
JObject json = JObject.Parse(str);
Example 2: c# parse json
Product product = new Product();
product.Name = "Apple";
product.Expiry = new DateTime(2008, 12, 28);
product.Price = 3.99M;
product.Sizes = new string[] { "Small", "Medium", "Large" };
string json = JsonConvert.SerializeObject(product);
Product deserializedProduct = JsonConvert.DeserializeObject<Product>(json);
Example 3: string json to class c#
var result = JsonConvert.DeserializeObject<YourClass>(jsonstring);