I am trying to deserialize a JSON array in the format such as below
[
{
"Id": 111,
"Name": "ABC"
},
{
"Id": 222,
"Name": "CDE"
},
{
"Id": 333,
"Name": "EFG"
}
]
I Have the class
public class IDInformation
{
public List<IDInformation> ID{ get; set; }
}
and I am trying to use it here where I am getting the Exception
Newtonsoft.Json.JsonSerializationException
var details= JsonConvert.DeserializeObject <IDInformation>(File);
I tried some of the fixes on some other SO questions as well but couldn't quite get what I wanted ..
What I am rying to do here is store all the ID in each of the separate JSON objects in a List (For example I want to iterate through this file and store 111,222,333 in a List )
Would really appreciate some help if anyone has come across something like this before.
IdandNameproperty.