Last active
November 1, 2017 04:40
-
-
Save Ibro/f2ab889981f11c90dc14f767ee8d7bdd 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 = Sum(a, b); | |
int difference = Difference(a, b); | |
return sum * difference; | |
int Sum(int x, int y) | |
{ | |
return x + y; | |
} | |
int Difference(int x, int y) | |
{ | |
return x - y; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment