Initially my json was in the format,
\"code\": 0,
\"message\": \"success\",
\"students\": [
{
\"id\": \"257633000000070001\",
\"name\": \"hje
If you using Newtonsoft.Json, try to use that classes:
public class StudentDetails
{
public string id { get; set; }
public string name { get; set; }
public int percentage { get; set; }
public string type { get; set; }
}
public class Student
{
public int code { get; set; }
public string message { get; set; }
public List students { get; set; }
}
After that, you can use that class to Deserialize responses using following way:
var parsedResponse = JsonConvert.DeserializeObject(data);
P.S. Of course, do not forget about [DataContract]
and [DataMember]
attributes