Language Integrated Query (LINQ) unifies the way data can be retrieved in the .NET Framework. Most of the features added to C# 3.0 support LINQ, and developers using .NET will certainly want to become familiar with LINQ. This book is part of the publisher’s “firstPress” series that advertises itself as a means to save time and effort. The books are short, and present material that might be available online or at conferences. But in print and electronically, these books promise quick, highly focused access to cutting-edge technology.
In some respects, this book succeeds in meeting the “firstPress” objectives. The introductory section shows why LINQ gains a big advantage over previous methods. Three chapters cover the three main LINQ applications to in-memory objects, databases, and Extensible Markup Language (XML) documents. Each chapter describes, one fragment at a time, an extended C# example that illustrates the LINQ features introduced in that chapter. The code for this edition was not yet available on the publisher’s site, so it could not be tested, but the examples provide good illustrations of LINQ usage.
The first chapter, on LINQ to Objects, presents all the LINQ standard query operators. The second, covering LINQ to ADO.NET, creates a people table, and shows how to use C# to work with the database directly from the language. It includes advanced DataContext features and other LINQ to SQL features, such as using stored procedures and using SQLMetal to produce entity classes automatically. The final chapter treats LINQ to XML.
Much of the material presented is available online, though perhaps not as nicely organized or presented. However, it is not easy to know if an online resource represents the latest LINQ improvements. A series such as “firstPress” would have a big advantage if it included the cutting-edge version of the topic. However, Ferracchiati states that he does not cover LINQ to Entities because it is not yet as mature as other technologies that can be used with LINQ. LINQ to Entities is a big improvement, allowing programming at a higher level that should greatly reduce program maintenance due to database changes; chapter 2 should have included it. While it would be much better if it was closer to the cutting edge, the book is well done and can be a useful way to learn LINQ.