mrahhal / MR.EntityFrameworkCore.KeysetPagination

Keyset/Seek/Cursor pagination for Entity Framework Core.
MIT License
218 stars 11 forks source link

Add Order method for KeysetPaginationBuilder for conditional ordering. #52

Closed a-a-k closed 8 months ago

a-a-k commented 8 months ago

Can be useful for cases when the order calculates based on a some input if we like to avoid redundant if-else branching.

mrahhal commented 8 months ago

Related to https://github.com/mrahhal/MR.EntityFrameworkCore.KeysetPagination/issues/50. Worth checking if you haven't.

I would rather make ConfigureColumn itself public. There's no need for an additional method that just calls into ConfigureColumn without doing anything else. Whether Order is a better name for this method can be argued though.

But as mentioned in https://github.com/mrahhal/MR.EntityFrameworkCore.KeysetPagination/issues/50#issuecomment-1779263978, if we do that I would want a KeysetColumnDirection enum instead of an opaque boolean for the isDescending param. You're welcome if you would like to work on that, but I would prefer a new PR.

a-a-k commented 8 months ago

I've just read #50 and agree.