Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Local Functions in C# 7
public class LocalFunctions
{
public int SomeProduct(int a, int b)
{
int Sum(int x, int y)
{
return x + y;
}
int Difference(int x, int y)
{
return x - y;
}
int sum = Sum(a, b);
int difference = Difference(a, b);
return sum * difference;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.