Back to course

Introduction to LINQ

.NET Zero to Hero: Master C# and Modern App Development

Language Integrated Query (LINQ)

LINQ allows you to query collections (like Lists or Arrays) in a way similar to SQL.

Example:

csharp using System.Linq;

int[] scores = { 90, 71, 82, 93, 75, 82 };

// Query syntax var highScores = from s in scores where s > 80 select s;

// Method syntax (More popular) var highScores2 = scores.Where(s => s > 80);