I need to convert a json list string to a C# list
My Model:
public class AddressModel
{
public string StateCode { get; set; }
public string CityCode { get; set; }
public string PinCode { get; set; }
public string Place { get; set; }
public string Street { get; set; }
public string DoorNo { get; set; }
public string State { get; set; }
public string City { get; set; }
public string AddresDetails{ get; set; }
}
Json:
"[\n {\n \"input\": {\n \"statecode\": 1,\n \"citycode\": 12,\n \"pincode\": \"123\",\n \"addresdetails\": \"\"\n },\n \"output\": [\n \n ]\n },\n {\n \"input\": {\n \"statecode\": 2,\n \"citycode\": 45,\n \"pincode\": \"765\",\n \"addresdetails\": \"\"\n },\n \"output\": [\n \n ]\n }\n]";
I tried with DeserializeObject but it's not working
var model = JsonConvert.DeserializeObject(json);
I would like to convert this into a list . could someone help me with this?