MR.EntityFrameworkCore.KeysetPagination icon indicating copy to clipboard operation
MR.EntityFrameworkCore.KeysetPagination copied to clipboard

Unable to get the Last page working

Open saisworld opened this issue 2 years ago • 1 comments

Hi,

I'm trying to get the "Last page" logic working. But it keeps returning the same first page rows. I following of logic mentioned in the documentation to use "backward"

searchResultsQuery.KeysetPaginate(_keysetBuilderAction, KeysetPaginationDirection.Backward);

but it keeps returning the same first page results. My query uses multiple joins across multiple tables using EF Core lambda. As EF Core doesnt support DistinctBy so I'm using .GroupBy(z=>z.Id).Select(g=>g.First()) for getting the Distinct rows in my query, is this causing an issue finding the last page ?

saisworld avatar Feb 05 '24 23:02 saisworld

Hi. A minimal repro would really help, as I won't be able to tell just from what you explained. Not sure how .GroupBy(z=>z.Id).Select(g=>g.First()) factors into this, would need to see the full code in a repro.

Would also help if you try to run the sample in this repo and double check there. If the sample works that means something's wrong with either how you're building this query or maybe there's an edge case in what you're using.

mrahhal avatar Feb 06 '24 12:02 mrahhal

I'm closing this, please reopen if you still have issues.

mrahhal avatar Apr 16 '24 09:04 mrahhal