diff --git a/src/EFCore.SqlServer/Query/Internal/Translators/SqlServerStringMethodTranslator.cs b/src/EFCore.SqlServer/Query/Internal/Translators/SqlServerStringMethodTranslator.cs index f1663ec86cb..49064a8293d 100644 --- a/src/EFCore.SqlServer/Query/Internal/Translators/SqlServerStringMethodTranslator.cs +++ b/src/EFCore.SqlServer/Query/Internal/Translators/SqlServerStringMethodTranslator.cs @@ -384,7 +384,7 @@ private SqlExpression TranslateIndexOf( private SqlExpression? ProcessTrimStartEnd(SqlExpression instance, IReadOnlyList arguments, string functionName) { - SqlConstantExpression? charactersToTrim = null; + SqlExpression? charactersToTrim = null; if (arguments.Count > 0 && arguments[0] is SqlConstantExpression { Value: var charactersToTrimValue }) { charactersToTrim = charactersToTrimValue switch