Cosmonaut icon indicating copy to clipboard operation
Cosmonaut copied to clipboard

WithPagination - have I can repeat my query?

Open KSemenenko opened this issue 5 years ago • 0 comments

I have a query like this:

await _postRepository.CosmosStore.Query().Where(w => w.SourceType == SourceType.News)
                        .OrderByDescending(o => o.PublishTime)
                        .WithPagination(1, 50).ToPagedListAsync();

and next I try to get next page:

await _postRepository.CosmosStore.Query().Where(w => w.SourceType == SourceType.News)
                            .OrderByDescending(o => o.PublishTime)
                            .WithPagination(token, 50).ToPagedListAsync();

but if I will remove Where part, I will have empty result.

Is there any way how I can use my token to continue get data without use my original query? like this:

await _postRepository.CosmosStore.Query()
                            .WithPagination(token, 50).ToPagedListAsync();

KSemenenko avatar Mar 23 '20 09:03 KSemenenko