Variables introduced within lambda expression not visible in outer method - LINQ
Q. Choose the correct one- Published on 31 Aug 15a. Variables introduced within a lambda expression are not visible in the outer method.
b. Variables introduced within a lambda expression are visible in the outer method.
c. The lambda should not contain the same number of parameters as the delegate type.
d. None of the above
ANSWER: Variables introduced within a lambda expression are not visible in the outer method.
A lambda expression is an anonymous function that you can use to create delegates
A variable, declared inside the anonymous method can’t be accessed outside the anonymous method but a variable, declared outside the anonymous method can be accessed inside the anonymous method.