如何使用 C# Facebook SDK 进行命名多重查询
我正在将一些遗留代码从旧的 3.0 版本的 C# Facebook SDK 更新到新的 5.3.2 版本。
在 http://developers.facebook.com/docs/reference/fql/ 它表明您可以执行如下多重查询:
"query1":"SELECT uid, rsvp_status FROM event_member WHERE eid=12345678"
"query2":"SELECT name, url, pic FROM profile WHERE id IN (SELECT uid FROM #query1)"
在旧 API 中,您只需拥有一个字典,其中每个查询都与其名称配对:
"page_admin_list","SELECT uid, page_id, type FROM page_admin where uid = 1234567890"
"permissions_response","SELECT uid, read_stream, status_update, photo_upload, publish_stream, offline_access FROM permissions WHERE uid IN (SELECT page_id FROM #page_admin_list)"
在每个示例中,请注意嵌套查询中的 #。但是,我不确定如何使用新语法来完成此操作,因为它只接受 string[] 作为参数。
I'm updating some legacy code from the old 3.0 version of the C# Facebook SDK to the new 5.3.2 version.
On http://developers.facebook.com/docs/reference/fql/
it shows that you can do a multiquery like:
"query1":"SELECT uid, rsvp_status FROM event_member WHERE eid=12345678"
"query2":"SELECT name, url, pic FROM profile WHERE id IN (SELECT uid FROM #query1)"
In the old API, you'd just have a Dictionary where each query was paired up with it's name:
"page_admin_list","SELECT uid, page_id, type FROM page_admin where uid = 1234567890"
"permissions_response","SELECT uid, read_stream, status_update, photo_upload, publish_stream, offline_access FROM permissions WHERE uid IN (SELECT page_id FROM #page_admin_list)"
In each of the examples, notice the # in the nested query. However, I'm unsure how to accomplish this with the new syntax since it is only accepting string[] as the parameter.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从 Facebook C# SDK v6 开始,您可以使用以下方法执行命名查询。
Starting from Facebook C# SDK v6 you can execute named queries using the following method.
找到这个答案(编辑:这适用于早期版本的 sdk,对于版本 6 及更高版本,请参阅 prabir 的答案):
我必须通过 #query0、#query1 等引用每个查询...
或者我可以使用 Get() 方法而不是 Query() 方法
Found this answer (edit: this applies to the earlier versions of the sdk, for version 6 and above see prabir's answer) :
I have to reference each query by #query0, #query1, etc...
Or I can use the Get() method rather than the Query() method