如何更改 WCF 数据服务返回的实体数量限制?
我注意到,无论我对 WCF 数据服务发出什么查询,我都只能返回 25 行。我如何修改客户端或服务以允许所有内容返回?
I've noticed that no matter what query I issue against a WCF Data Service, I only ever get 25 rows back. How can I modify either the client or the service to allow all to come back?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您拥有该服务,那么这完全取决于您。如果您不拥有该服务并且作者希望以这种方式提供服务,则您无法更改此服务(这是很好的安全功能)。
如果您只得到 25 并且请求没有失败(并且您确定有超过 25 个),那么您还应该在响应中看到下一个链接(在最后),它指向下一个 25,依此类推。
在服务器上,这通常是通过调用 InitializeService 中的 config.SetEntitySetPageSize 方法来设置的。
If you own the service then this is totally up to you. If you don't own the service and the author wanted it this way, there's no way for you to change this (which is good, security feature).
If you get only 25 and the request doesn't fail (and you're sure there's more than 25) then you should also see a next link in the response (at the very end), which points to the next 25 and so on.
On the server this is usually setup by calling config.SetEntitySetPageSize method in the InitializeService.