Lambda expressions that are converted to delegates are converted to methods. Your code is equivalent to:
class Program { static void Main(string[] args) { Action whatToDo = MyLambda;
... except that the compiler is smart enough to create new classes where necessary for captured variables, etc. Although my conversion has an additional method called MyLambda , the C # compiler generates unspeakable names that are not valid C # identifiers (to avoid collisions, do not let you access them directly, etc.).
source share