Apress

Pro LINQ

Language Integrated Query in C# 2010

By Joseph Rattz , Adam Freeman

Pro LINQ Cover Image

Most books show the simplest examples of how to use a method, but they so rarely show how to use the more complex prototypes. This book is different. Demonstrating the overwhelming majority of LINQ operators and prototypes, it is a veritable treasury of LINQ examples.

Full Description

  • ISBN13: 978-1-4302-2653-6
  • User Level: Intermediate to Advanced
  • Publication Date: June 29, 2010
  • Available eBook Formats: PDF
  • Print Book Price: $44.99
  • eBook Price: $31.99
Buy eBook Buy Print Book Add to Wishlist

Related Titles

Full Description

LINQ is the part of the .NET Framework that provides a generic approach to querying data from different data sources. It has quickly become the next must-have skill for .NET developers. Pro LINQ: Language Integrated Query in C# 2010 is all about code. Literally, this book starts with code and ends with code. Most books show the simplest examples of how to use a method, but they so rarely show how to use the more complex prototypes. This book is different. Demonstrating the overwhelming majority of LINQ operators and prototypes, it is a veritable treasury of LINQ examples.

Rather than obscure the relevant LINQ principles in code examples by focusing on a demonstration application you have no interest in writing, this book cuts right to the chase of each LINQ operator, method, or class. However, where complexity is necessary to truly demonstrate an issue, the examples are right there in the thick of it. For example, code samples demonstrating how to handle concurrency conflicts actually create concurrency conflicts so you can step through the code and see them unfold.

Face it, most technical books, while informative, are dull. LINQ need not be dull. Written with a sense of humor, this book will attempt to entertain you on your journey through the wonderland of LINQ and C# 2010.

What you’ll learn

  • How to leverage all the new LINQ relevant C# 2008 language features including extension methods, lambda expressions, anonymous data types, and partial methods.
  • How to use LINQ to Objects to query in-memory data collections such as arrays, ArrayLists, and Lists to retrieve the data you want.
  • Why some queries are deferred, how a deferred query can bite you, and how you can make deferred queries work for you.
  • How to use LINQ to XML to revolutionize your creation, manipulation, and searching of XML data.
  • How to query DataSets with LINQ to DataSet so you can coexist with legacy code and use LINQ to query databases other than SQL Server.
  • How to query Databases with LINQ to SQL, write your own entity classes, and understand how to handle concurrency conflicts.

Who this book is for

This book is written for the proficient C# developer, but you do not need to be up on all the latest C# features to understand the material. When you finish this book, you will have a much greater understanding of the latest C# features.

Table of Contents

Table of Contents

  1. Hello LINQ   
  2. C# Language Enhancements for LINQ   
  3. LINQ to Objects Introduction  
  4. Deferred Operators  
  5. Nondeferred Operators   
  6. LINQ to XML Introduction   
  7. The LINQ to XML API   
  8. LINQ to XML Operators   
  9. Additional XML Capabilities   
  10. LINQ to DataSet Operators  
  11. Additional DataSet Capabilities   
  12. LINQ to SQL Introduct ion   
  13. LINQ to SQL Tips and Tools   
  14. LINQ to SQL Database Operations   
  15. LINQ to SQL Ent ity Classes   
  16. The LINQ to SQL DataContext   
  17. LINQ to SQL Concurrency Conflicts   
  18. Additional LINQ to SQL Capabilities   
  19. LINQ to Entities Introduction   
  20. LINQ to Entities Operations   
  21. LINQ to Entities Classes  
  22. Parallel LINQ Introduction   
  23. Using Parallel LINQ   
  24. Parallel LINQ Operators  
Source Code/Downloads

Downloads are available to accompany this book.

Your operating system can likely extract zipped downloads automatically, but you may require software such as WinZip for PC, or StuffIt on a Mac.

Errata

If you think that you've found an error in this book, please let us know about it. You will find any confirmed erratum below, so you can check if your concern has already been addressed.

* Required Fields

On page 70:
Code line should read:

return ((Employee[])GetEmployeesArrayList().ToArray(typeof(Employee)));

instead of just

return((Employee[])GetEmployeesArrayList().ToArray));