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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With