C# deserialize json to object Edit

Murugan Andezuthu Dharmaratnam | 25 September 2020 | 538

I have a javascript array of countries. I convert that to JSON and sent it to C#, Now I want to convert the JSON to a C# List. Below is the JSON I want to convert to C# list of objects.


I need to convert the list of countries into a C# list of countries like the class below.

public class Country
    public int Id { get; set; }
    public int Code { get; set; }
    public String Name { get; set; }

Check the code to deserialize the object.


List<country> lstCountries = Newtonsoft.Json.JsonConvert.DeserializeObject<list<country>>(jsondata);