Hi Friends,
i have a JSON string. I need to convert it into list of objects. How can i do this?
I created a class for this.Below are the details. please help
string Restresponse = string.Empty;
Restresponse = reader.ReadToEnd();
JObject json = JObject.Parse(Restresponse);
class Plans
{
public string AssumptionsOverrides { get; set; }
public string ChannelId { get; set; }
public string Clients { get; set; }
public string CreatedDate { get; set; }
public string CustomAssetClasses { get; set; }
public string FaNumber { get; set; }
public string Href { get; set; }
public string LastAnalysisDate { get; set; }
public string Name { get; set; }
public string OfficeNumber { get; set; }
public string PlanId { get; set; }
public string Scenarios { get; set; }
public string Settings { get; set; }
public string UpdatedDate { get; set; }
public string VerificationTimestamp { get; set; }
}
{
"plans": [{
"planId": 10001,
"name": "My Client Plan 1",
"href": null,
"channelId": "WSGPLN",
"officeNumber": 101,
"faNumber": 195,
"createdDate": "2016-01-27T15:43:50",
"updatedDate": "2016-01-27T15:43:50",
"lastAnalysisDate": null,
"clients": null,
"scenarios": null,
"settings": null,
"assumptionsOverrides": null,
"customAssetClasses": null,
"verificationTimestamp": "2016-01-27T15:43:50"
},
{
"planId": 10025,
"name": "My Client Plan 25",
"href": null,
"channelId": "WSGPLN",
"officeNumber": 101,
"faNumber": 195,
"createdDate": "2016-01-27T15:43:50",
"updatedDate": "2016-01-27T15:43:50",
"lastAnalysisDate": null,
"clients": null,
"scenarios": null,
"settings": null,
"assumptionsOverrides": null,
"customAssetClasses": null,
"verificationTimestamp": "2016-01-27T15:43:50"
}],
"metadata": {
"totalCount": 25,
"offset": null,
"limit": null
}
}