Paging with WCF data service

≡放荡痞女 提交于 2019-12-01 23:48:21

Unfortunately it seems that WCF data services is way too limited, and the solution for me was to switch to a regular WCF service so that I could use full LINQ and define data contracts myself.

Have a look at the Paging Provider for WCF Data Services here and here

Use Skip and Take to perform client side paging of data from the WCF data service, such as:

var items = (from i in ctx.MyEntities
             select i).Skip(StartIndex).Take(PageSize)

Where StartIndex is the beginning position of the data you want returned and PageSize is the number of elements max to return.

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