我有以下 Fql 查询:
https://graph.facebook.com/fql?q={"query1":"SELECT uid2 FROM friend WHERE uid1=me()","query2":"SELECT uid , name , pic_square , affiliations , birthday_date , sex , relationship_status , hometown_location , current_location , education_history , work_history , contact_email FROM user WHERE (sex='male') AND uid IN (SELECT uid2 FROM #query1)"}
这在图形浏览器中工作正常,但在 C# 中不起作用;我收到 Http Badrequest 错误
我的查询如下:
"fql?q={'query1':'SELECT+uid2+FROM+friend+WHERE+uid1=me()','query2':'SELECT+uid,name,pic_square,affiliations,birthday_date,sex,relationship_status,hometown_location,current_location,education_history,work_history,contact_email+FROM+user+WHERE+(sex='male')+AND+uid+IN+(SELECT+uid2+FROM+#query1)'}";
请帮忙。
最佳答案
var fb = new Facebook.FacebookClient(token);
dynamic result = fb.Query(
"SELECT uid2 FROM friend WHERE uid1=me()",
"SELECT uid, name, pic_square, affiliations, birthday_date, sex, relationship_status, hometown_location, current_location, education_history, work_history, contact_email" +
" FROM user WHERE (sex='male') AND uid IN (SELECT uid2 FROM #query0)"
);
命名约定从索引 0 开始,而不是像其他语言一样从索引 1 开始。上面的代码有效,我在 C# 中运行了它,结果很好。
关于c# - Fql 多查询在图形资源管理器中执行,但不在 c# .net 中执行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9530195/