CodeGenHelpers
CodeGenHelpers copied to clipboard
CodeWriter Invoke methode
Currently when we want to Invoke something in a method body we have to use AppendLine:
methodBuilder.WithBody((x) =>
{
x.AppendLine($"await Test(argument1, argument2));
});
Idea would be to create an "InvocationBuilder" which we could use like this:
x.Invoke(useAwait, methodname, params, prefix, suffix);
When interested i would volunteer to create a PR.
Can you expand on this idea @Codelisk? Like is the goal to produce:
public string Speak()
{
return Speak("Hello World");
}
Yes thats pretty much it :)