protected override ArgumentSyntax CreateArgumentSyntax() { ParenthesizedLambdaExpressionSyntax expression = null; if (_blockSyntax != null) { expression = ParenthesizedLambdaExpression(_blockSyntax); } else { expression = ParenthesizedLambdaExpression(_expressionSyntax); } if (_parameters.Any()) { expression = expression.WithParameterList(ParameterGenerator.ConvertParameterSyntaxToList(_parameters.Select(p => Parameter(Identifier(p.Name))).ToArray())); } return(Argument(expression)); }
private MethodDeclarationSyntax BuildParameters(MethodDeclarationSyntax method) { return(!_parameters.Any() ? method : method.WithParameterList(ParameterGenerator.ConvertParameterSyntaxToList(_parameters.ToArray()))); }