-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
New SortAndPage operator #917
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a high-level note, am I correct in reading that Virtualize
and Page
are just the same thing? Is there any actual difference, other than the indexing parameters?
var paramsChanged = _pageRequests.Synchronize(locker) | ||
.DistinctUntilChanged() | ||
// exclude dodgy params | ||
.Where(parameters => parameters is { Page: > 0, Size: > 0 }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this filter out some valid requests? E.G. { Page: 0, Size: 10 }
? Or is Page
here 1-indexed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It just ignores bad input. The other alternative would be just to throw an exception
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dang, I just re-read your comments. Page zero is not valid. Paging always starts at 1.
Indeed so. It's almost the same but I've replaced it because it already exists and we can bet our bottom dollar that someone is suing it in the wild. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This is the following up to the SortAndVirtualize - see #888
If is an almost a direct lift of the code but using page based calculations. This is part of the drive to eliminate the Sort operator altogether, and subsequently the need to propagate the index on
Change<TObject,TKey>
.Old
New
There is a also a new
Bind()
overload to bind the results of the page response.Additionally I have renamed SortAndBind which acts on a a virtual response to
Bind()
.I just need and replace
SortBy
withSortByAndBind
operator and I am happy to make the big version release.