Elfocrash / Cosmonaut

🌐 A supercharged Azure CosmosDB .NET SDK with ORM support
https://cosmonaut.readthedocs.io
MIT License
342 stars 44 forks source link

WithPagination - have I can repeat my query? #127

Open KSemenenko opened 4 years ago

KSemenenko commented 4 years ago

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();