Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paging of query results when using LINQ #41

Open
pksorensen opened this issue Feb 23, 2021 · 1 comment
Open

Paging of query results when using LINQ #41

pksorensen opened this issue Feb 23, 2021 · 1 comment

Comments

@pksorensen
Copy link
Member

We have a few cases where we are writing QueryExpression due to being able to use the continuation token / page cookie to retrieve the data in batches over more requests.

I am wondering if would make sense to make this around linq also. However i dont expect it to be easy.

I am thinking that we would be able to write set.where(...).select(...).ToPaginatedResult() or something that make sense, that returns a

class PagedResult<T> : IList<T>{

public string ContinuationToken {get;set;}

}

Where is the ContinuationToken is the cookie or some base64 encoded string of the data needed to return the next page?

Then on the second result, the same query can be used.

set.where(...).select(...).ToPaginatedResult(continuationToken)

Which allows me to persist the continuation token between calls and continue until no continuation token is present.

@pksorensen
Copy link
Member Author

@magesoe @bo-stig-christensen Does this make sense to you to do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants