Lambda expressions in C#?
Posted
by user30457
on Super User
See other posts from Super User
or by user30457
Published on 2010-03-12T20:02:41Z
Indexed on
2010/03/12
20:08 UTC
Read the original article
Hit count: 577
c#
Hey I'm rather new to these could someone explain the significance 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,
© Super User or respective owner