
If you are looking for a single book that provides great coverage of
Pro LINQ
does a fantastic job providing numerous examples, offering tips and suggestions, and building one's confidence on the subjects.
I think the term "Pro" in the title reflects the amount of information and examples in the book and what you will become if you digest all of it. You certainly don't need to be a Pro to read the book as it gently starts you at the very beginning by introducing all the new language features in C# 3.0 that have been introduced to support LINQ or make LINQ easier to use in some way: anonymous types, lambda expressions, extension methods, object and collection initializers, expression trees, partial methods, query expression, etc. The coverage of these features was great. Many of the features were put into context of previous language features, such as the evolution from named methods to anonymous methods to lambda expressions for example.
The book then introduces you to each flavor of LINQ, providing numerous examples on how to use them. If you learn best by looking at code and other people's examples, you will appreciate the thorough coverage through examples. I find this especially important when trying to understand how to use the various query operators introduced in LINQ. The LINQ To Objects Section takes you through detailed use of every deferred and non-deferred query operator, and you will find yourself reaching for the book quite often when you first start building queries.
The section on LINQ To DataSets helped me get ready for a presentation that I mentioned in a previous post, LINQ To DataSet is Really Cool and Makes DataSet and DataTable More Useful for Demos. If it were not for the examples in the book, I wouldn't have been able to solve the problem as quickly and elegantly in the 5 or 10 minutes it took me. Took me longer to write that post :)
The LINQ To SQL section is really thorough as well, guiding you through the Visual Designer, SQLMetal, DataContext, Entity Classes, Database Operations, Overriding Default Behavior, etc. as well as O/R Mapping concepts like Identity Map, Change Tracking, Unit of Work, Eager and Deferred Loading, etc. A lot of good information for those who want to use LINQ To SQL as an O/R Mapper in your applications. I didn't see anything about the LINQDataSource, but that will be covered in your favorite ASP.NET 3.5 Book I am sure.
In conclusion, if you are looking for one book to get you up to speed on the various flavors of LINQ as well as be a good reference book when you get stuck, Pro LINQ is a great book to have on your desk. I highly recommend it.
by David Hayden