@@ -35,8 +35,9 @@ internal static class ExpressionParserUtilities
35
35
/// Get's the operand string.
36
36
/// </summary>
37
37
/// <param name="exp">the expression to parse.</param>
38
+ /// <param name="filterFormat">whether the operand should be filter formatted.</param>
38
39
/// <returns>The operand string.</returns>
39
- internal static string GetOperandString ( Expression exp )
40
+ internal static string GetOperandString ( Expression exp , bool filterFormat = false )
40
41
{
41
42
return exp switch
42
43
{
@@ -46,7 +47,7 @@ internal static string GetOperandString(Expression exp)
46
47
$ "@{ ( ( ConstantExpression ) method . Arguments [ 0 ] ) . Value } ",
47
48
MethodCallExpression method => GetOperandString ( method ) ,
48
49
UnaryExpression unary => GetOperandString ( unary . Operand ) ,
49
- BinaryExpression binExpression => ParseBinaryExpression ( binExpression ) ,
50
+ BinaryExpression binExpression => ParseBinaryExpression ( binExpression , filterFormat ) ,
50
51
LambdaExpression lambda => GetOperandString ( lambda . Body ) ,
51
52
_ => string . Empty
52
53
} ;
@@ -156,8 +157,8 @@ internal static string ParseBinaryExpression(BinaryExpression rootBinaryExpressi
156
157
var binExpressions = SplitBinaryExpression ( rootBinaryExpression ) ;
157
158
foreach ( var expression in binExpressions )
158
159
{
159
- var right = GetOperandString ( expression . Right ) ;
160
- var left = GetOperandString ( expression . Left ) ;
160
+ var right = GetOperandString ( expression . Right , filterFormat ) ;
161
+ var left = GetOperandString ( expression . Left , filterFormat ) ;
161
162
if ( filterFormat && ( ( expression . Left is MemberExpression mem &&
162
163
mem . Type == typeof ( string ) ) || ( expression . Left is UnaryExpression uni &&
163
164
uni . Type == typeof ( string ) ) ) )
@@ -678,7 +679,7 @@ private static string TranslateFormatMethodStandardQuerySyntax(MethodCallExpress
678
679
string [ ] args ;
679
680
if ( exp . Arguments [ 1 ] is NewArrayExpression newArrayExpression )
680
681
{
681
- args = newArrayExpression . Expressions . Select ( GetOperandString ) . ToArray ( ) ;
682
+ args = newArrayExpression . Expressions . Select ( x => GetOperandString ( x ) ) . ToArray ( ) ;
682
683
}
683
684
else
684
685
{
0 commit comments