O'Reilly logo

LINQ Pocket Reference by Joseph Albahari, Ben Albahari

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 1. LINQ Pocket Reference

LINQ, or Language Integrated Query, allows you to write structured type-safe queries over local object collections and remote data sources. It is a new feature of C# 3.0 and .NET Framework 3.5.

LINQ lets you query any collection implementing IEnumerable<>, whether an array, list, XML DOM, or remote data source (such as a table in SQL Server). LINQ offers the benefits of both compile-time type checking and dynamic query composition.

The core types that support LINQ are defined in the System.Linq and System.Linq.Expressions namespaces in the System.Core assembly.

Note

The examples in this book mirror the examples in Chapters 8–10 of C# 3.0 in a Nutshell (O’Reilly) and are preloaded into an interactive querying tool called LINQPad. You can download LINQPad from http://www.linqpad.net/.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required