May 2010
Intermediate to advanced
1272 pages
61h 18m
English
The new version of WCF Data Services introduced by .NET 4.0 presents a new feature known as server-driven paging. This feature enables paging data directly on the server and provides developers the ability of specifying how many items a page must return, also offering an Uri for browsing the next page. To enable server-driven paging, you simply invoke the DataServiceConfiguration.SetEntitySetPageSize method that requires specifying the entity set name and the number of items per page. The following code demonstrates this:
config.SetEntitySetPageSize("Orders", 4)
If you now start the service and try to fetch all orders, you get the result shown in Figure 42.10.
Figure 42.10 Server-driven paging demonstration. ...
Read now
Unlock full access