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.page 1 | 2

Book Review: Pro LINQ – Language Integrated Query in C# 2008 by Joseph C. Rattz, Jr.

Language INtegrated Query; or LINQ, is a Microsoft .NET Framework component that adds native data querying capabilities to the .NET languages using syntax similar to SQL. LINQ is a part of the .NET Framework 3.5 and was released with the Visual Studio 2008 release on November 19, 2007. Pro LINQ: Language Integrated Query in C# 2008 is written for the proficient C# developer who wants to learn this new technology. The author’s aim is to give you the information that matters, in a form that is usable. Instead of focusing on a complex demonstration application that cannot be put to practical use, he focuses on each of the examples as necessary. For example, when he is explaining concurrency conflicts, he has an example that creates a conflict so that you can step through it to see the conflict in action. Pro LINQ: Language Integrated Query in C# 2008 is 600 pages divided into 18 chapters segmented into 5 parts. I will cover this review based on the 5 parts. Part 1, “Pro LINQ: Language Integrated Query in C# 2008″ begins by asking the question; “Did you just feel your world shift?” With the release of the .NET Framework 3.5, you should have. LINQ is going to change the way that developers query data. Soon, vendors will be adding “LINQ compatible” stickers to their products. Virtually any kind of data store would make a good candidate for supporting LINQ queries. In this part you will be introduced to exactly what LINQ is, what it is not, and how it can be used. You will find some initial tips, and get an early taste of what the code looks like. Then you will get into C# 3.0’s language enhancements for LINQ. These include new object and collection initialization expressions, the ability to stub in static, sample or test data is much easier, as well as reducing the number of lines of code to create the data. Plus there is a lot more here to learn as well. One thing to note is that LINQ to Entities is not covered in this book because it is outside the core LINQ framework. Part 2, “LINQ to Objects” looks at how you can use LINQ to work with objects; that is to work with any IEnumerable or IEnumerable) collection directly. If you have an array of integers and it needs to be sorted, you can now perform a LINQ query to order the results in the same way you would with a SQL query. You will begin with learning what sequences are, the data type that represents them, and the impact of deferred query execution. It can work for or against you, so its understanding is of key importance. After you learn about the deferred operators, you will then learn about nondeferred operators. By the time you are done, you will have nearly 50 operators to choose from. Part 3, “LINQ to XML” now moves on to XML. Here you will begin by seeing the standard methods for dealing with XML by using the W3C DOM XML API. Creating XML documents this way is a nightmare that is not only hard to read, it is even harder to support. In LINQ to XML, Microsoft not only supports queries, but it fixed a number of deficiencies in the XML API. First the author begins by showing how to create XML hierarchies in a fraction of the code; 10 lines as opposed to 29 lines. He also shows you how to create, modify and traverse XML documents as well as performing queries on an XML object. page 1 | 2