private static List <SyntaxNodeOrToken> CreateWcfArguments(SeparatedSyntaxList <ParameterSyntax> wcfParameters) { var arguments = wcfParameters // add arguments using wcf method parameters .Select(parameter => { var argument = SyntaxFactory.Argument(SyntaxFactory.IdentifierName(parameter.Identifier)); // add 'out' keyword if param has it var hasOutKeyword = OutKeywordGenerator.HasOutKeyword(parameter); argument = hasOutKeyword ? OutKeywordGenerator.AddOutKeywordToArgument(argument) : argument; return(argument); }) // add commas .SelectMany(param => new SyntaxNodeOrToken[] { param, SyntaxFactory.Token(SyntaxKind.CommaToken) }) // remove last trailing comma .Take(wcfParameters.Count * 2 - 1) .ToList(); return(arguments); }