Data Developer Center > Data Platform Development Forums > WCF Data Services > Where is SetEntitySetPageSize method?

Answered Where is SetEntitySetPageSize method?

Answers

  • Thursday, April 01, 2010 8:37 PM
    Moderator
     
     Answered

    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 PM
    Moderator
     
     Answered

    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