Caffeinated Coder
Book an appointment
Lesson 14 · Working with data

LINQ

LINQ (Language-Integrated Query) lets you query any sequence with methods such as Where and Select, each driven by a lambda. Follow one query over the array {72, 45, 90, 61}: building it runs nothing (deferred execution); a foreach then pulls items through one at a time, Where drops 45, Select adds 5, and the console prints 77, 95, 66. ToList runs the whole query again and keeps the results.

14 min9 steps5 questionsBeginner
Fig 14 · Interactive
Loading figure…
or ← →

Quiz Unlocks after the last step.