-
Notifications
You must be signed in to change notification settings - Fork 5
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
Query'ing without any Take or Skip restriction only loads first page #60
Comments
Still thinking about this. The problem here is that this would only work as long as no other sort criteria has been added to the command. So please be patient before we take a closer look to your PR. |
The command itself still has all the functionality intact. The only thing it does is adding an enumerator that actually yields all results instead of just the first default page. All criteria should apply on the API. Maybe I miss something and you can elaborate? |
I'm not sure how this works, but bumping this after 3 and a half years. |
Using
client.Query<T>()
one will only receive the default 20 items from the first page. If we want to get more than that or all items of the given T, then we are bound to Skip and Take ourselves in a loop.This approach however has one major flaw. Before the first execution of the query, you basically have no idea how many items you have in total, nor does the
Query<T>()
extension return the total value if QueryparameterwithTotal=true
.A solution to that would be a
client.QueryAll<T>()
extension in addition to an appropriate enumerator for that case.The enumerator will keep track of the current page items and retrieves new ones, if the page is exhausted.
Example:
As you can see, the syntax would be nearly the same, while providing all items of a requested type on demand. So it will also not flood the machines memory with all the requested items at once.
The text was updated successfully, but these errors were encountered: