private CSharpCodeWritingScope BuildLambda(bool endLine, bool async, string[] parameterNames) { if (async) { Write("async"); } Write("(").Write(string.Join(", ", parameterNames)).Write(") => "); var scope = new CSharpCodeWritingScope(this); if (endLine) { // End the lambda with a semicolon scope.OnClose += () => { WriteLine(";"); }; } return(scope); }
private CSharpCodeWritingScope BuildLambda(bool endLine, bool async, string[] parameterNames) { if (async) { Write("async"); } Write("(").Write(string.Join(", ", parameterNames)).Write(") => "); var scope = new CSharpCodeWritingScope(this); if (endLine) { // End the lambda with a semicolon scope.OnClose += () => { WriteLine(";"); }; } return scope; }