C# Lambda expressions: Why should I use them?

I have quickly read over the Microsoft Lambda Expression documentation.

This kind of example has helped me to understand better, though:

delegate int del(int i);
del myDelegate = x => x * x;
int j = myDelegate(5); //j = 25

Still, I don’t understand why it’s such an innovation. It’s just a method that dies when the “method variable” ends, right? Why should I use this instead of a real method?

15 Answers
15

Leave a Comment