-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow expression row value comparisons via extension methods #2349
Comments
roji
added a commit
to roji/efcore.pg
that referenced
this issue
May 4, 2022
roji
added a commit
to roji/efcore.pg
that referenced
this issue
May 4, 2022
roji
added a commit
to roji/efcore.pg
that referenced
this issue
May 4, 2022
This was referenced May 4, 2022
roji
added a commit
to roji/efcore.pg
that referenced
this issue
May 4, 2022
roji
added a commit
to roji/efcore.pg
that referenced
this issue
May 6, 2022
OK, I ended up going in a slightly different direction, and using _ = await ctx.Customers
.Where(c => EF.Functions.GreaterThan(
new ValueTuple<string, string>(c.City, c.CustomerID),
new ValueTuple<string, string>("Buenos Aires", "OCEAN")))
.CountAsync(); This is a bit uglier/more verbose, but:
/cc @smitpatel |
roji
changed the title
Allow expression row value comparisons via extension method with object array parameters
Allow expression row value comparisons via extension methods
May 6, 2022
roji
added a commit
to roji/efcore.pg
that referenced
this issue
May 6, 2022
roji
added a commit
to roji/efcore.pg
that referenced
this issue
May 7, 2022
roji
added a commit
that referenced
this issue
May 7, 2022
roji
added a commit
to npgsql/doc
that referenced
this issue
May 8, 2022
Docs: npgsql/doc@511a6af in the 7.0 branch. |
This was referenced May 17, 2022
roji
added a commit
to npgsql/doc
that referenced
this issue
May 17, 2022
roji
added a commit
to npgsql/doc
that referenced
this issue
Jun 5, 2022
roji
added a commit
to roji/Npgsql.Doc
that referenced
this issue
Jul 10, 2022
roji
added a commit
to roji/Npgsql.Doc
that referenced
this issue
Aug 24, 2022
roji
added a commit
to roji/Npgsql.Doc
that referenced
this issue
Aug 24, 2022
roji
added a commit
to npgsql/doc
that referenced
this issue
Aug 24, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See dotnet/efcore#26822 - this implements that but for PG only.
Most databases allow comparing row value expressions:
This is is notably useful for keyset pagination with multiple keys (see this detailed presentation).
I prevently implemented #2111 and reverted a bad approach, which pattern-matched the expanded form above in the tree, and replaced it with the row value expression. This was both brittle (some tree shapes failed to be matched), and also results in complicated LINQ queries.
Ideally, users would be able to express row value comparisons in LINQ queries by using value tuples (see dotnet/efcore#26822):
However, since value tuple syntax isn't yet supported in C# expression trees, we can allow object arrays instead:
/cc @mrahhal
The text was updated successfully, but these errors were encountered: