diff --git a/Common/src/gRPC/ExpressionExt.cs b/Common/src/gRPC/ExpressionExt.cs index e872251b1..fd1513a1d 100644 --- a/Common/src/gRPC/ExpressionExt.cs +++ b/Common/src/gRPC/ExpressionExt.cs @@ -30,8 +30,9 @@ public static class ExpressionExt public static Expression> ExpressionAnd(this Expression> expr1, Expression> expr2) => Expression.Lambda>(Expression.AndAlso(expr1.Body, - expr2.Body), - expr2.Parameters); + Expression.Invoke(expr2, + expr1.Parameters)), + expr1.Parameters); /// /// Combines two predicate expressions using a logical OR condition @@ -43,6 +44,7 @@ public static Expression> ExpressionAnd(this Expression> ExpressionOr(this Expression> expr1, Expression> expr2) => Expression.Lambda>(Expression.OrElse(expr1.Body, - expr2.Body), - expr2.Parameters); + Expression.Invoke(expr2, + expr1.Parameters)), + expr1.Parameters); }