Skip to content
This repository was archived by the owner on Feb 1, 2025. It is now read-only.

Commit 3f39e42

Browse files
committed
fix PgBinaryExpression support
1 parent 982d53b commit 3f39e42

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Source/LinqToDB.EntityFrameworkCore/EFCoreMetadataReader.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -657,10 +657,11 @@ string PrepareExpressionText(Expression? expr)
657657
return text;
658658
}
659659

660-
// https://github.com/npgsql/efcore.pg/blob/main/src/EFCore.PG/Query/Expressions/Internal/PostgresBinaryExpression.cs
661-
if (newExpression.GetType().Name == "PostgresBinaryExpression")
660+
// https://github.com/npgsql/efcore.pg/blob/main/src/EFCore.PG/Query/Expressions/Internal/PgBinaryExpression.cs
661+
// renamed in 8.0.0
662+
if (newExpression.GetType().Name == "PgBinaryExpression")
662663
{
663-
// Handling Npgsql PostgresBinaryExpression
664+
// Handling Npgsql PgBinaryExpression
664665

665666
var left = (Expression)newExpression.GetType().GetProperty("Left")!.GetValue(newExpression)!;
666667
var right = (Expression)newExpression.GetType().GetProperty("Right")!.GetValue(newExpression)!;
@@ -699,7 +700,7 @@ string PrepareExpressionText(Expression? expr)
699700
"JsonExistsAny" => "?|",
700701
"JsonExistsAll" => "?&",
701702
_ => throw new InvalidOperationException(
702-
$"Unknown PostgresBinaryExpression.OperatorType: '{operand}'")
703+
$"Unknown PgBinaryExpression.OperatorType: '{operand}'")
703704
};
704705

705706
switch (operand)

0 commit comments

Comments
 (0)