Where is SetEntitySetPageSize method?
-
Thursday, April 01, 2010 8:24 PM
Hi,
I am developing with VS 2008 SP1 on Windows XP with all latest service packs. I downloaded the latest ADO.NET Data Services release for .NET 3.5 SP 1 from:
as linked to in this announcement post:
The announcement post lists separate downloads for Win 7 / 2008 R2 and all other OS versions. I downloaded from the link to other OS versions.
Server Driven Paging (SDP) does not seem to be included in this release.
When I try to add the SetEntitySetPageSize() method to the config object within the InitializeService method it does not show up in Intellisense. This method is not defined on the IDataServiceConfiguration interface.
Is SDP not supported for the other OS's besides Win 7 / 2008 R2? Or am I missing something like maybe an assembly reference to bring in an extension method?
Thanks in advance.
Answers
-
Thursday, April 01, 2010 8:37 PMModerator
Hi James,
The SetEntitySetPageSize APIs are decalred on the DataServiceConfiguration type and not the IDataServiceConfiguration interface.
In the InitializeService method , change the type of the "config" parameter to be DataServiceConfiguration , instead of IDataServiceConfiguration .
You should then be able to access the paging APIs.
Phani Raj Astoria http://blogs.msdn.com/PhaniRaj- Marked As Answer by James Richards Thursday, April 01, 2010 8:45 PM
All Replies
-
Thursday, April 01, 2010 8:37 PMModerator
Hi James,
The SetEntitySetPageSize APIs are decalred on the DataServiceConfiguration type and not the IDataServiceConfiguration interface.
In the InitializeService method , change the type of the "config" parameter to be DataServiceConfiguration , instead of IDataServiceConfiguration .
You should then be able to access the paging APIs.
Phani Raj Astoria http://blogs.msdn.com/PhaniRaj- Marked As Answer by James Richards Thursday, April 01, 2010 8:45 PM
-
Thursday, April 01, 2010 8:50 PM
Thanks Phani. Changing the config parameter type did the trick.
But then I got a runtime error: "Server paging cannot be used when the MaxProtocolVersion of the data service is set to DataServiceProtocolVersion.V1"
So I also had to add another line of code:
config.DataServiceBehavior.MaxProtocolVersion =
System.Data.Services.Common.DataServiceProtocolVersion.V2;which in turn required adding a reference to the System.Data.Services.Client assembly.
Bottom line - it's working now. Thanks for your quick response!
- James

