Created
November 1, 2017 04:42
-
-
Save Ibro/87e076f15890820b420692f8e9cac4e6 to your computer and use it in GitHub Desktop.
Local Functions in C# 7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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