Skip to content

Instantly share code, notes, and snippets.

@petrsvihlik
Created September 30, 2022 08:43
Show Gist options
  • Save petrsvihlik/4544262830de8b08667428087a0268ea to your computer and use it in GitHub Desktop.
Save petrsvihlik/4544262830de8b08667428087a0268ea to your computer and use it in GitHub Desktop.
Nested discard parameters
Func<string, string, string> action = new Func<string, string, string>((_, parameter) =>
{
string function(string x)
{
Console.WriteLine(x);
return x;
}
_ = function(parameter);
return "whatever";
});
var result = action("x", "y");
Console.WriteLine(result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment