From 025e567153b58efbb19efe011ae0a5d0893e7fec Mon Sep 17 00:00:00 2001 From: Victor Irzak Date: Mon, 3 Jan 2022 10:05:08 -0500 Subject: [PATCH] Concatenate binary data using || --- src/EFCore.PG/Query/Internal/NpgsqlQuerySqlGenerator.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/EFCore.PG/Query/Internal/NpgsqlQuerySqlGenerator.cs b/src/EFCore.PG/Query/Internal/NpgsqlQuerySqlGenerator.cs index f08ff4c25..f1b532f02 100644 --- a/src/EFCore.PG/Query/Internal/NpgsqlQuerySqlGenerator.cs +++ b/src/EFCore.PG/Query/Internal/NpgsqlQuerySqlGenerator.cs @@ -1,3 +1,4 @@ +using System.Collections; using System.Net; using System.Net.NetworkInformation; using System.Text.RegularExpressions; @@ -90,6 +91,8 @@ protected override string GetOperator(SqlBinaryExpression e) // string type mapping. Same for full-text search's TsVector. ExpressionType.Add when e.Type == typeof(string) || e.Left.TypeMapping?.ClrType == typeof(string) || e.Right.TypeMapping?.ClrType == typeof(string) || + e.Type == typeof(BitArray) || e.Left.TypeMapping?.ClrType == typeof(BitArray) || e.Right.TypeMapping?.ClrType == typeof(BitArray) || + e.Type == typeof(byte[]) || e.Left.TypeMapping?.ClrType == typeof(byte[]) || e.Right.TypeMapping?.ClrType == typeof(byte[]) || e.Type == typeof(NpgsqlTsVector) || e.Left.TypeMapping?.ClrType == typeof(NpgsqlTsVector) || e.Right.TypeMapping?.ClrType == typeof(NpgsqlTsVector) => " || ", ExpressionType.And when e.Type == typeof(bool) => " AND ", @@ -742,4 +745,4 @@ public virtual Expression VisitPgFunction(PostgresFunctionExpression e) private static bool RequiresBrackets(SqlExpression expression) => expression is SqlBinaryExpression || expression is LikeExpression || expression is PostgresBinaryExpression; -} \ No newline at end of file +}