I would like to convert following Json Array to .net list wrapper. Not sure how ca I do that.
Json Array:
[{"Name" : "SomeName1", "Age" : "20" },{ "Name" : "SomeName2", "Age" : "21"}]
My class is:
public class Person
{
public string Name;
public string Age;
}
If I use List<Person>
as my conversion type then everything works fine.
But what I would like to do is to convert above array to following class's object;
public class PersonList
{
public string somefield;
public List<Person> PersonList;
}
I am not able to convert my array to List wrapper object. How can I do that?
I do not have control over conversion method. I am using RestSharp library to execute my web request. When I call execute method, I would like to pass PersionList type for conversion and not List