Basic lambda expressions with LINQ C# with Example



Basic lambda expressions with LINQ C# with Example

// assume source is {0, 1, 2, ..., 10} 
var evens = source.Where(n => n%2 == 0); 
// evens = {0, 2, 4, ... 10} 
var strings = source.Select(n => n.ToString()); 
// strings = {"0", "1", ..., "10"} 

0 Comment's

Comment Form

Submit Comment