Author: Paolo Pialorsi & Marco Russo
Publisher: Microsoft Press, 2010
Aimed at: .NET programmers
Pros: Good and comprehensive coverage, well structured
Cons: Focuses on C# and ignores VB.NET
Reviewed by: Mike James
A whole, quite thick, book on LINQ? Is this sensible? Is there so much to say?
The answer is yes if you want to really understand LINQ and use it in different ways with a range of different technologies.
It is difficult to know if LINQ is part of the language or the framework but this book focuses on using it with C# and while this shouldn't be a huge problem it will put some VB .NET programmers off as there are differences in syntax if not principles.
First we have a focused overview of LINQ including LINQ to objects, ADO .NET and XML. Each of the Query keywords is then explained not only so that you know how to use them but also so that you have a good chance fo understanding how they work. There is even a short section which introduces the specific VB keywords. Then Chapter 3 goes into LINQ to objects in detail. This may not be the most useful or exciting application of LINQ but it is a good place to understand how it all works because the datasource should be well understood and you can see clearly how the two parts - data source and query - interact.
Part II of the book is about LINQ to Relational which is a neat way of saying either SQL or Entity. The first chapter discussed the two technologies and tries to help you pick which one to choose. I have to admit that even with its help I am still not sure which to use in any given situation - but this is not the book's fault. LINQ to SQL is relatively easy to use and well understood. LINQ to Entities is still new, still developing and while it is clearly the best theoretical way to go practice is another matter. The authors have the same problem in that they can't come off the fence and ignore one of the technologies in favour of the other so we have three chapters on SQL and three on Entities. The section closes with a welcome look at LINQ to DataSet which is a surprisingly useful but often overlooked way of doing things.
Part III is on LINQ to XML which is necessary but not as important as it was as it has to be admitted that XML is going out of fashion in favour of JSON.
Part IV is titled "Advanced LINQ" and you might be forgiven in thinking that this is what you had been reading about in the earlier parts! Advanced LINQ takes you inside the technology to look at expression trees and how to extend LINQ to create your own technology. It also covers parallel LINQ both PLINQ and parallelism in general.
The final part of the book is about applied LINQ and again you would be forgiven for thinking that this topic was also part of the earlier chapters. Chapter 18 looks at how LINQ fits into the overall architecture of the application. The final chapter looks at using LINQ in conjunction with data binding in ASP .NET, WPF, Silverlight and Windows Forms. All well worth reading.
If you want to be a master of LINQ then this book is for you. It's long but it is well structured and you can pick the parts that most interest you and read them in isolation. Highly recommended.