Click here to Skip to main content
15,610,660 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, my problem is simple; from the [^]there is a lambda expression that bugs me:

SendAction(() => All().CallOnEach<IListenTo<T>>(x => x.Handle(message)));

The first closed paranthesis comes with no prefix. Because of that i don't understand what this expression is supposed to mean. Any help is welcome.

1 solution

this just means "void" so no "Input" variables for the first lambda (the second one defines one "x" - in this case it's allowed to leave the paranthesis away. So SendAction wants a function pointer (aka delegate) as Argument - you just give it one - inline with your lambda. Does this help?
Share this answer
YourAverageCoder 3-Sep-13 5:39am    
Yes, thanks.
johannesnestler 3-Sep-13 6:50am    
You are welcome. Little Addition: If you think about the syntax it's obviouse that the compiler needs something in case of no input parameters to recognize the Lambda - why .NET didn't "create" a new use for the "void" keyword is beyond my knowledge (They did it with "this" for the ExtensionMethods)...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900