Lambdas for both `Func` and `Action` C# with Example



Lambdas for both `Func` and `Action` C# with Example

Typically lambdas are used for defining simple functions (generally in the context of a linq expression): 
var incremented = myEnumerable.Select(x => x + 1); 
Here the return is implicit. 
However, it is also possible to pass actions as lambdas: 
myObservable.Do(x => Console.WriteLine(x)); 

0 Comment's

Comment Form

Submit Comment