Ask a questionAsk a question
 

QuestionIDataServicePagingProvider.SetContinuationToken

  • Sunday, October 18, 2009 1:17 PMFrank Chow Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    The documentation in V1.5 CTP2 describes the signature as

    IQueryable SetContinuationToken (
     IQueryable query,
     ResourceType resourceType,
     Object[] continuationToken
    )

    However, its declaration in the assembly is actually 

    void SetContinuationToken (
     IQueryable query,
     ResourceType resourceType,
     Object[] continuationToken
    )

    Which one is correct? Also, any insight into how to go about implementing the interface?


    ...Sorry, posted in the wrong forum.

    • Edited byFrank Chow Monday, October 19, 2009 4:35 PMwrong forum
    •  

All Replies

  • Monday, October 19, 2009 4:47 PMFrank Chow Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    In CTP2 documentation, it describes the IDataServicePagingProvider.SetContinuationToken call signature as

    IQueryable SetContinuationToken (
     IQueryable query,
     ResourceType resourceType,
     Object[] continuationToken
    )

    However in the assembly it is declared as  

    void SetContinuationToken (
     IQueryable query,
     ResourceType resourceType,
     Object[] continuationToken
    )

    Which is correct?

    I implemented the PagingProvider and the DS runtime is calling SetContinuationToken with the proper arguments as such. However, I can't properly control the result set that is being returned to the client.

    Frank


    More information..

    DS runtime calls RequestQueryProcessor.ProcessSkipToken to handling paging. Following is from .NET Reflector

          if (this.IsCustomPaged)
            {
                this.ApplyCustomPaging(queryStringItem);
            }
            else
            {
                this.ApplyStandardPaging(queryStringItem);
            }

    RequestQueryProcessor.ApplyStandardPaging which in turns calls  RequestUriProcessor.InvokeWhereForType to further filters the query into the desired result set.

           this.query = RequestUriProcessor.InvokeWhereForType(this.query, this.orderingParser.BuildSkipTokenFilter(this.topLevelOrderingInfo, instance));

    However, in RequestQueryProcessor.ApplyCustomPaging the call to SetContinucationToken is as follows

           this.service.PagingProvider.PagingProviderInterface.SetContinuationToken(this.query, this.description.LastSegmentInfo.TargetResourceType, continuationToken);

    I just don't see how I can properly filter the result set.

  • Tuesday, October 20, 2009 1:59 AMPhani Raju MSFTModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi fcschow,

      The  documentation is incorrect for this interface., I will follow up internally.
     
      In the meantime , this interface is supposed to help one setup a custom paging provider for their  Data Service.
      Do you need to customize the default paging behavior ?
      If yes , some details of the behavior you are trying to achieve would be helpful in answering your question meaningfully.

    Phani Raj Astoria http://blogs.msdn.com/PhaniRaj
  • Tuesday, October 20, 2009 1:45 PMFrank Chow Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hi Phani,

    Thanks for your reply.

    I am one of those whom brought into the original SSDS ACE model (because we have a EAV-based application) and now have to do our own implementation.

    For now, I am merely trying to replicate the DS default behavior using the custom provider interfaces so as to gain insight into our own implementation.

    First, I implemented the IDataServiceQueryProvider over CLR objects. Most behavior work as expected including "Open Type".

    I run into a dead-end with IDataServicePagingProvider. I use DataServiceConfiguration.SetEntitySetPageSize to alter the size, and when the DS runtime calls IDataServicePagingProvider.SetContinuationToken there is nothing I do to alter to the result set. As a result, I always get back the entire result set. DS default paging does behavior correctly if i left out my custom implementation.

    The IDataServicePagingProvider interface described in the document does make sense. It gives implementation the ablility to alter the result set. I believe IDataServiceProjectionProvider.ApplyProjection works the same way.

    Thoughts.

    fcschow