LINQ (Language Integrated Query) provides a unified, expressive way to query and transform data — collections, databases, XML — using a consistent syntax. It brings functional-style operations (filter, map, group, aggregate) directly into C#, making data manipulation concise and readable.
Method syntax (the common form)
adults = people
.Where(p => p.Age >= )
.OrderBy(p => p.Name)
.Select(p => p.Name.ToUpper())
.ToList();
total = numbers.Sum();
count = people.Count(p => p.IsActive);
first = people.FirstOrDefault(p => p.Id == );
any = people.Any(p => p.Age > );
groups = people.GroupBy(p => p.City);
max = people.Max(p => p.Age);
