diff --git a/src/EFCore.PG/Query/Internal/NpgsqlSqlTranslatingExpressionVisitor.cs b/src/EFCore.PG/Query/Internal/NpgsqlSqlTranslatingExpressionVisitor.cs index cbc64eaf9..e6194f099 100644 --- a/src/EFCore.PG/Query/Internal/NpgsqlSqlTranslatingExpressionVisitor.cs +++ b/src/EFCore.PG/Query/Internal/NpgsqlSqlTranslatingExpressionVisitor.cs @@ -456,8 +456,7 @@ methodType switch translation = _sqlExpressionFactory.Like( translatedInstance, - new SqlParameterExpression(escapedPatternParameter.Name!, escapedPatternParameter.Type, stringTypeMapping), - _sqlExpressionFactory.Constant(LikeEscapeChar.ToString())); + new SqlParameterExpression(escapedPatternParameter.Name!, escapedPatternParameter.Type, stringTypeMapping)); return true; } diff --git a/test/EFCore.PG.FunctionalTests/Query/CitextQueryTest.cs b/test/EFCore.PG.FunctionalTests/Query/CitextQueryTest.cs index 20d48e02e..1ff63672d 100644 --- a/test/EFCore.PG.FunctionalTests/Query/CitextQueryTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/CitextQueryTest.cs @@ -48,7 +48,7 @@ public void StartsWith_param_pattern() SELECT s."Id", s."CaseInsensitiveText" FROM "SomeEntities" AS s -WHERE s."CaseInsensitiveText" LIKE @__param_0_startswith ESCAPE '\' +WHERE s."CaseInsensitiveText" LIKE @__param_0_startswith LIMIT 2 """); } @@ -102,7 +102,7 @@ public void EndsWith_param_pattern() SELECT s."Id", s."CaseInsensitiveText" FROM "SomeEntities" AS s -WHERE s."CaseInsensitiveText" LIKE @__param_0_endswith ESCAPE '\' +WHERE s."CaseInsensitiveText" LIKE @__param_0_endswith LIMIT 2 """); } @@ -156,7 +156,7 @@ public void Contains_param_pattern() SELECT s."Id", s."CaseInsensitiveText" FROM "SomeEntities" AS s -WHERE s."CaseInsensitiveText" LIKE @__param_0_contains ESCAPE '\' +WHERE s."CaseInsensitiveText" LIKE @__param_0_contains LIMIT 2 """); }