InvalidCastException while trying to deserialize JSON in C# InvalidCastException while trying to deserialize JSON in C# json json

InvalidCastException while trying to deserialize JSON in C#


(old question but why not answer it :))

Your Json does not match a list of persons but is only 1 object containing a property persons (which is a list of persons)

Like:

public class AllPeople {   public List<Person> Persons { get;set; }}