Am I right in saying that lambda expressions exist only at compile time, and once compiled they become either an Expression (LambdaExpression?) or a delegate?
Asked
Active
Viewed 259 times
1 Answers
16
Yes. In addition to a delegate, lambdas become a generated method. The delegate refers to that method. If they close over variables, the method becomes an instance method on a generated class holding the closure state.
In that sense you can use a lambda and local variables to create a class with fields and one method, similar to JavaScript.

Mike Christensen
- 88,082
- 50
- 208
- 326

usr
- 168,620
- 35
- 240
- 369