感谢Prabir 的博客,我可以使用 facebook c# sdk v 6.14 成功执行多查询 fql,但在解析结果时需要帮助。我已经搜索并尝试了很多方法都无济于事。我知道这是一个简单的语法问题,但我对 c# 和 JSON 还很陌生。
任何帮助深表感谢!谢谢,乍得
我的代码:
var fb = new FacebookClient(this.FacebookAccessToken);
dynamic resultsMQFQL = fb.Get("fql",
new
{
q = new
{
friendsMovies = "SELECT page_id, uid FROM page_fan WHERE type='MOVIE' AND uid IN (SELECT uid2 FROM friend WHERE uid1=me()) ORDER BY page_id",
movieDetails = "SELECT page_id, name, pic, fan_count, categories, genre, starring, release_date FROM page WHERE page_id IN (SELECT page_id FROM #friendsMovies) ORDER BY fan_count DESC",
}
});
结果:
{"data":[
{"name":"friendsMovies",
"fql_result_set":
[{"page_id":105638652803531,"uid":796419451},
{"page_id":113271808686307,"uid":796419451}]},
{"name":"movieDetails",
"fql_result_set":[
{"page_id":105638652803531,"name":"Fear and Loathing in Las Vegas"},
{"page_id":113271808686307,"name":"Fletch"}
]
}
]}
尝试解析:
foreach (dynamic row in resultsMQFQL.data.fql_result_set)
错误:
'Facebook.JsonArray' does not contain a definition for 'fql_result_set'