I'm getting the JSON output as follows:
{"data":
[
{
"name":"followersQuery",
"fql_result_set":[{"subscriber_count":300}]
},
{
"name":"likesQuery",
"fql_result_set":[{"like_count":0}]
}
]
}
It is the output of multiple fql
query.
I have created the following classes to deserialize the output:
public class ResultCount
{
[JsonProperty("subscriber_count")]
public int Followers { get; set; }
[JsonProperty("like_count")]
public int Likes { get; set; }
}
public class ResultItem
{
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("fql_result_set")]
public ResultCount ResultCounts { get; set; }
}
public class FacebookData
{
public List<ResultItem> Items { get; set; }
}
I'm getting error while de-serializing the output in the following line:
JsonConvert.DeserializeObject<FacebookData>(myOutput);
The error is:
The best overloaded method match for 'Newtonsoft.Json.JsonConvert.DeserializeObject(string)' has some invalid arguments.
Not able to correct this. Can anyone please correct this?
Many many thanks in advance!