Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Local functions with C# 7
// C# 6
public void SomeFunStuff()
{
Func<int, int, int> add = (x, y) => x + y;
int result = add(38, 4);
Console.WriteLine(result);
}
// C# 7
public void SomeFunStuff()
{
int add(int x, int y) => x + y;
int result = add(38, 4);
Console.WriteLine(result);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment