Open Grauenwolf opened 4 years ago
I ran into a similar issue and as you already said, it is because of the disallowed client-side evaluation. In your case the client-side evaluation is probably triggered by the string.Compare
clause (https://github.com/dotnet/efcore/issues/18020 describes exactly the same).
DbSet<Transaction>
.OrderBy(t => t.ContactCity)
.Where(
/* This line may triggers a client-side evaluation */
t => string.Compare(strA: t.ContactCity, strB: __TypedProperty_0, comparisonType: Ordinal) > 0 ||
t.ContactCity == __TypedProperty_0 &&
t.TxnId > __TypedProperty_1
)
Before EF Core 3.0, such queries were executed client-side anyway, so this is a good reason to work on it and make them more efficient :)
When sorting by two columns, the first being a string, it throws an exception when a
$skiptoken
is provided.Assemblies affected
Reproduce steps
The simplest set of steps to reproduce the issue. If possible, reference a commit that demonstrates the issue.
Expected result
What would happen if there wasn't a bug.
Actual result
Additional detail
I suspect that this is a breaking change caused by EF Core 3.x no longer allowing client-side evaluation. (Though to be fair, this query should be executed server-side.)