What is a local function in C#?
Correct answer C. A method declared inside another method and visible only within it
Explanation
Since C# 7, you can declare a named method inside the body of another member. It is private to that member, can capture its local variables and parameters, and can be recursive or generic. Local functions are useful for helper logic and for validating arguments eagerly in iterator or async methods. There is no local access modifier in C#.
Answer checked How we write and check questions
Discussion