C# 7 Features

In this blog post we will discuss about the Local functions/methods, Ref returns and locals, Expression bodied members,Throw Exception from Expression Local Methods/Functions Now we can define local functions inside another.Ya, That's right, C# 7 version provides the ability to call a function which is defined inside another function. static void Main(string[] args) { int localvar = 50; //local function defined inside main method int LocalFunction(int a) { return localvar * a; } Console.WriteLine(LocalFunction(50)); } If we observe the code above, local function with the name "LocalFunction" is defined inside the main method and called by main method itself. This is how we can define a local function to perform a specific operation and return value to the enclosed functio...