All methods should also have overloads that accept the pagination query model directly as an argument, as opposed to parsing it from the request query.
// Won't parse anything from the request's query.
var usersPaginationResult = await _paginationService.KeysetPaginateAsync(
_dbContext.Users,
b => b.Descending(x => x.Created),
async id => await _dbContext.Users.FindAsync(int.Parse(id)),
queryModel: new KeysetQueryModel
{
// Get the first page, with 10 items.
First = true,
Size = 10,
});
All methods should also have overloads that accept the pagination query model directly as an argument, as opposed to parsing it from the request query.