I ve searched on this, but don t really know how to word the question to get the answer so far I can t find anything on nested actions like this with Lambda expressions. I can find lots of help on passing lambda expressions as parameters where the parameter is a delegate and in fact I m doing that lots in my code. It s the nested lambda expression that s giving me problems.
I have a class with a property of type
Action<Action<string,int>> myAction
and I want to assign it with a Lambda expression. I can do it without Lambda expressions using real methods that I have elsewhere in the code. I can also do something simple like
myAction = ((a) => { a("a string", 0); });
but I would like to asign the sub-action and the action in one Lambda. Something like...
myAction = (((s,i)=>{//sub-action body here})=> { //do something here});
But this syntax doesn t work. Is there a way to do this, or do I have to define my methods in advance and do it without a Lambda expression if I want to do this?