C# Local Functions
C# local functions are the private methods having same type in which it is defined. Local function can be called only from its container member.
Local functions are used to make code clear and readable.
We can declare local function in the following scope.
Local function is a nested function and has the following syntax.
C# Local Function Syntax
Local methods do not allow access modifiers even private. Members of local variable are private implicitly.
Let's see an example.
C# Local Function Example
sum of 10 and 20 is: 30