Thursday , April 18 2024
If you want to get up to speed quickly then LINQ Unleashed for C# will give you the boost you need.

Book Review: LINQ Unleashed for C# by Paul Kimmel

Language Integrated Query; also known as LINQ, is a Microsoft .NET Framework component that adds native data querying capabilities to the .NET languages using a syntax similar to SQL. The goal of LINQ is to make it easy to retrieve any information programmatically from any data source by unifying how data is accessed, no matter where it comes from, or how it is stored.

LINQ Unleashed for C# was written as a definitive guide to getting real world results from LINQ using C# 3.0 and Visual Studio 2008. The author's goal is to try to show you how to dramatically improve your productivity, build more reliable and easily maintained applications. It is 552 pages in length and divided into 23 chapters and further divided into four sections.

Part I, "Get Ready for LINQ," begins by introducing anonymous types, variables without a defined type in which the compiler is relied upon to resolve the actual type information. This is an important concept since these are used thought the book for the retrieval of query results. Next, there is an examination of compound type initialization which not only makes it easier to initialize arrays and lists, but it is essential for working with anonymous types.

You will learn about extension methods which will permit you to add behaviors to intrinsic types, sealed classes, and keep deep inheritance trees under control. Next, you will then see the evolution path to Lambda Expression, and how to write and use Lambda Expressions. Finally you will learn about the standard query operators that make up part of the full capability of the.NET Framework.

Part II, "LINQ for Objects," looks at how to use LINQ queries with an IEnumerable or IEnumerable(T) collections directly, and without the use of an intermediate LINQ provider. In this section you will learn about sorting; primary, secondary, and reversing sorts, and grouping queries using key and element pairs, the use of aggregate operations, and performing set operations.

You will also see how to master Select and SelectMany, how to join query results, and how to query Outlook and Active directory objects. This will serve you well in seeing how LINQ can work with external items, and get you started in being able to query any thing that serves data as an enumerable collection.

Part III, "LINQ for Data," shows that now everything you have learned so far can be leveraged in this section, the difference being that now you will get this data from a SQL Server provider. You will see that LINQ can be used to query data sets directly, or you can use DataContext and Table. The basic chore is to define a standard object-relational mapping that maps to a C# entity class in a database.

You will see how to create better entities and mapping inheritance and aggregation, how to join database tables using LINQ queries, update data anonymous relational data, work with the ADO.NET 3.0, and the Entity Framework.

Part IV, "LINQ for XML," provides an in-memory XML programming interface that uses the LINQ Framework, and is comparable to an updated, redesigned, Document Object Model (DOM) XML programming interface. Before, this was accomplished using XPath, but now LINQ provides an alternative method, and experience.

In this section you will learn how to extract data from XML, compare LINQ with other XML technologies, construct XML from non-XML Data, and combine XML with other data models.

Up until now, programmers had to know C# to manipulate objects, SQL to manipulate databases, and XPath and XSLT to manipulate XML. LINQ now gives you a uniform way to manage all platforms, so you can focus on the problems, not the technology

LINQ Unleashed for C# is well-defined, and well-executed. It is written in a clear and concise manner, making learning LINQ interesting, and easy to do. With it being one of the first books on LINQ, it is certainly a definitive guide to getting results in a fast and in a real world way. 

Kimmel covers every facet of LINQ programming, and takes you down the road by using easy to use, and adaptable examples, yet detailing the most powerful new LINQ techniques to show you how to dramatically improve your productivity, and build more reliable, and effective applications. I highly recommend this book.

About T. Michael Testi

Photographer, writer, software engineer, educator, and maker of fine images.

Check Also

Book Review: ‘A Pocketful of Happiness’ by Richard E. Grant

Richard E. Grant details how his wife, Joan Washington, lived her final months and inspired him to find a pocketful of happiness in each day.