In C#, are lambda expressions objects? If so, what sort of object are they?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Lambda expressions themselves only exist in source code. They don’t have a type themselves, which is why the compiler always insists they’re convert to a specific type.
That’s why this code doesn’t compile:
But this does:
Lambda expressions are always converted to either a delegate type or an expression tree type. Similarly, anonymous methods are always converted to a delegate type.