lambda expressions in C#?
Posted
by Matt
on Stack Overflow
See other posts from Stack Overflow
or by Matt
Published on 2010-03-12T20:11:39Z
Indexed on
2010/03/12
20:17 UTC
Read the original article
Hit count: 648
c#
Hey I'm rather new to these could someone explain the significance (of the following code) or prehaps give a link to some useful information on lambda expressions? I encounter the following code in a test and I am wondering why someone would do this:
foo.MyEvent += (o, e) => { fCount++; Console.WriteLine(fCount); };
foo.MyEvent -= (o, e) => { fCount++; Console.WriteLine(fCount); };
My instinct tells me it is something simple and not a mistake, but I don't know enough about these expressions to understand why this is being done.
Regards,
© Stack Overflow or respective owner