C#: understanding linq

Example:

var numbers = new List { 1, 2, 3, 4, 5 };
LINQ (Language Integrated Query) provides native language querying capabilities to C#.

Solution:

var evenNumbers = numbers.Where(n => n % 2 == 0);  // Outputs: 2, 4

Beginner's Guide to C#