WCF 中 OData 的查询限制有哪些?
简而言之,我想了解从查询的角度使用 OData 的局限性的总结。例如:
- 我可以进行递归查询吗?
- 它包含哪些 LINQ 功能子集?
我发现规格很长,难以分析。
I would like to know, in a nutshell, a summary of the limitations of using OData from the point of view of the query. For example:
- Can I do recursive queries?
- What subset of LINQ features it includes?
I found that the specs are very long to analyze.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,当您询问 OData 的查询限制时,我认为您指的是 WCF 数据服务的限制。 OData 是协议;支持或不支持 OData 协议的语法和操作关键字的实现取决于 OData 提供者(在您的情况下是 WCF 数据服务,我相信您将问题标记为 WCF)。
鉴于此,这篇 MSDN 文章中详细说明了 LINQ 功能的子集。限制的数量相当大,因此最好直接链接到它而不是列出它们。
对于您关于递归查询的第一个问题,我必须承认我不确定典型的 LINQ 递归函数是什么样子,除非您定义自己的扩展方法。如果您正在做类似的事情,最好的选择可能是将递归调用包装在 WCF 数据服务自定义服务方法中,并像调用任何其他服务方法一样通过 URL 调用它。
我希望这有帮助!
Well, when you ask about the query limitations of OData, I think you mean the limitations of WCF Data Services. OData is the protocol; the implementation of what's supported or not in conjunction with the syntax and operation keywords of the OData protocol is up to the OData provider (which is WCF Data Services in your case, I believe since you tagged the question as WCF).
Given that, the subset of LINQ features are spelled out in this MSDN article. The number of limitations is pretty substantive, so it's probably better to just link to it instead of listing them out.
For your first question about recursive queries, I have to admit I'm not sure of how a typical LINQ recursive function would look like, unless you define your own extension method. If you're doing something like that, your best bet may be to wrap that recursive call in a WCF Data Service custom service method and invoke it via the URL as you would any other service method.
I hope this helps!