I have this Json Array
[{"Fname":"Axe","Lname":"Venture" },{"Fname":"dsa","Lname":"das"}]
I am Using JSON.net to deserialize the Json array. My Class is as below
public class Cifo
{
public string Fname { get; set; }
public string Lname { get; set; }
}
The json array will be store in a string namely JSONData , when there is only 1 Json Data such as {“Fname”:”Axe”,”Lname”:”Venture” } . my code will not return any error . but when I have more than 1 JSON array data like above . I will get an exception “Cannot deserialize JSON array into type ‘myClassName+Cifo’.”
I am using this code to deserialize JsonConvert.DeserializeObject<Cifo>(JSONData)
How can I parse all the json data and store into an object ?
Try to deserializa to a list