From c4bf915eb0a2b65bad679210155ab9d187fa0bfe Mon Sep 17 00:00:00 2001 From: Mohammad Rahhal Date: Wed, 24 Nov 2021 20:55:26 +0200 Subject: [PATCH] Fix ThenBy order --- .../KeysetPaginationExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MR.EntityFrameworkCore.KeysetPagination/KeysetPaginationExtensions.cs b/src/MR.EntityFrameworkCore.KeysetPagination/KeysetPaginationExtensions.cs index 2c6e9ca..a73eb14 100644 --- a/src/MR.EntityFrameworkCore.KeysetPagination/KeysetPaginationExtensions.cs +++ b/src/MR.EntityFrameworkCore.KeysetPagination/KeysetPaginationExtensions.cs @@ -348,7 +348,7 @@ private static IOrderedQueryable ThenOrderBy(IOrderedQueryable query, Keys { isDescending = !isDescending; } - return isDescending ? query.ThenBy(accessExpression) : query.ThenByDescending(accessExpression); + return isDescending ? query.ThenByDescending(accessExpression) : query.ThenBy(accessExpression); } private static Expression> MakeMemberAccessLambda(PropertyInfo property)