private GetParamName ( System.Linq.Expressions.ParameterExpression e ) : string | ||
e | System.Linq.Expressions.ParameterExpression | |
return | string |
Node ParseExpression(LambdaExpression e) { var parser = new ExpressionParser(e.Body, textOnly: true, baseParamIndex: _nextParamIndex, testClass: TestClass); string parameters; if (e.Parameters.Count == 0) { parameters = "()"; } else if (e.Parameters.Count == 1) { parameters = parser.GetParamName(e.Parameters[0]); } else { parameters = "(" + string.Join(", ", e.Parameters.Select(GetParamName)) + ")"; } return(new BinaryNode { Operator = "=>", Left = new ConstantNode { Text = parameters }, Right = parser.Parse(), }); }
Node ParseExpression(LambdaExpression e) { var parser = new ExpressionParser(e.Body, textOnly:true, baseParamIndex:_nextParamIndex, testClass:TestClass); string parameters; if (e.Parameters.Count == 0) { parameters = "()"; } else if (e.Parameters.Count == 1) { parameters = parser.GetParamName(e.Parameters[0]); } else { parameters = "(" + string.Join(", ", e.Parameters.Select(GetParamName)) + ")"; } return new BinaryNode { Operator = "=>", Left = new ConstantNode { Text = parameters }, Right = parser.Parse(), }; }