Passing a Lambda Expression as a Parameter to a Method

Download c# eBook

Example

List<int> l2 = l1.FindAll(x => x > 6);

Here x => x > 6 is a lambda expression acting as a predicate that makes sure that only elements above 6 are returned.

Stats

Contributors: 3
2016-07-28
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook