how to increase return records size odata service from client side?

只愿长相守 提交于 2019-12-11 11:21:58

问题


I have wcf odata service return me some records, but when it records are returned it returns some limited number of records (100). I searched the web and found that there are some configuration parameters set in service initialization.

  • MaxResultSetsPerCollection
  • SetEntitySetPageSize

Reference

But is it possible to override these from the client side, when the service is consumed. if so how to do it. I want to set records returned to be 1000 instead of 100


回答1:


No, you cannot increase the server-defined page size from a client. The goal of server-driven paging is to allow a server to only allocate a certain amount of its resources to a single request. As a client, you can request fewer results than the server would normally send back using the $top and $skip query parameters in the request URL, but you cannot request more.

If a server gives you 100 entities at a time, you can request the next set of 100 by following the continuation URL (aka "next link") provided at the end of the payload. If you're the using WCF Data Service client library, take a look at the answer to this question for an example of how to follow a next link: paging through NetFlix odata results.



来源:https://stackoverflow.com/questions/19010497/how-to-increase-return-records-size-odata-service-from-client-side

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!