LINQ Pocket Reference: Learn and Implement LINQ for .NET Applications

LINQ Pocket Reference: Learn and Implement LINQ for .NET Applications

by Joseph Albahari, Ben Albahari
LINQ Pocket Reference: Learn and Implement LINQ for .NET Applications

LINQ Pocket Reference: Learn and Implement LINQ for .NET Applications

by Joseph Albahari, Ben Albahari

eBook

$12.99  $16.99 Save 24% Current price is $12.99, Original price is $16.99. You Save 24%.

Available on Compatible NOOK Devices and the free NOOK Apps.
WANT A NOOK?  Explore Now

Related collections and offers


Overview

Ready to take advantage of LINQ with C# 3.0? This guide has the detail you need to grasp Microsoft's new querying technology, and concise explanations to help you learn it quickly. And once you begin to apply LINQ, the book serves as an on-the-job reference when you need immediate reminders.

All the examples in the LINQ Pocket Reference are preloaded into LINQPad, the highly praised utility that lets you work with LINQ interactively. Created by the authors and free to download, LINQPad will not only help you learn LINQ, it will have you thinking in LINQ.

This reference explains:

  • LINQ's key concepts, such as deferred execution, iterator chaining, and type inference in lambda expressions
  • The differences between local and interpreted queries
  • C# 3.0's query syntax in detail-including multiple generators, joining, grouping, query continuations, and more
  • Query syntax versus lambda syntax, and mixed syntax queries
  • Composition and projection strategies for complex queries
  • All of LINQ's 40-plus query operators
  • How to write efficient LINQ to SQL queries
  • How to build expression trees from scratch
  • All of LINQ to XML's types and their advanced use

LINQ promises to be the locus of a thriving ecosystem for many years to come. This small book gives you a huge head start.

"The authors built a tool (LINQPad) that lets you experiment with LINQ interactively in a way that the designers of LINQ themselves don't support, and the tool has all kinds of wonderful features that LINQ, SQL and Regular Expression programmers alike will want to use regularly long after they've read the book."-Chris Sells, Connected Systems Program Manager, Microsoft


Product Details

ISBN-13: 9781449370411
Publisher: O'Reilly Media, Incorporated
Publication date: 02/26/2008
Series: Pocket Reference (O'Reilly)
Sold by: Barnes & Noble
Format: eBook
Pages: 174
File size: 1 MB

About the Author

Joseph Albahari is a core C# design architect at Egton Medical Information Systems, the largest primary healthcare software supplier in the UK. He has been developing large-scale enterprise applications on .NET and other platforms for more than 15 years, working in medical, telecommunication and education industries. Joseph specializes in writing custom components and controls, and has designed application component frameworks for three companies.


Ben Albahari is currently involved in the bioinformatics business. He was a Program Manager at Microsoft for 5 years, where he worked on several projects, including the .NET Compact Framework and ADO.NET.

He was the cofounder of Genamics, a provider of tools for C# and J++ programmers, as well as software for DNA and protein sequence analysis. He is a co-author of C# Essentials, the first C# book from O'Reilly, and of previous editions of C# in a Nutshell.

Table of Contents

Getting Started     1
Lambda Queries     4
Chaining Query Operators     4
Composing Lambda Expressions     6
Natural Ordering     9
Other Operators     9
Comprehension Queries     10
Iteration Variables     12
Query Syntax Versus SQL Syntax     13
Query Syntax Versus Lambda Syntax     13
Mixed Syntax Queries     14
Deferred Execution     15
Reevaluation     16
Outer Variables     17
How Deferred Execution Works     17
Chaining Decorators     19
How Queries Are Executed     20
Subqueries     22
Subqueries and Deferred Execution     25
Composition Strategies     25
Progressive Query Building     25
The into Keyword     27
Wrapping Queries     28
Projection Strategies     30
Object Initializers     30
Anonymous Types     30
The let Keyword     32
Interpreted Queries     33
How Interpreted Queries Work     35
AsEnumerable     38
LINQ to SQL     40
LINQ to SQL Entity Classes     40
DataContext     42
Automatic Entity Generation     45
Associations     45
Deferred Execution with LINQ to SQL     47
DataLoadOptions     48
Updates     50
Building Query Expressions     52
Delegates Versus Expression Trees     53
Expression Trees     55
Query Operator Overview     59
Filtering     62
Where     63
Take and Skip     65
TakeWhile and SkipWhile     65
Distinct     66
Projecting     66
Select     67
SelectMany     72
Joining     82
Join and GroupJoin     83
Ordering     92
OrderBy, OrderByDescending, ThenBy, ThenByDescending     92
Grouping     95
GroupBy     96
Set Operators     100
Concat and Union     100
Intersect and Except     100
Conversion Methods     101
OfType and Cast     101
ToArray, ToList, ToDictionary, ToLookup     103
AsEnumerable and AsQueryable      104
Element Operators     104
First, Last, Single     105
ElementAt     106
DefaultlfEmpty     107
Aggregation Methods     107
Count and LongCount     107
Min and Max     108
Sum and Average     109
Aggregate     110
Quantifiers     111
Contains and Any     111
All and SequenceEqual     112
Generation Methods     112
Empty     112
Range and Repeat     113
LINQ to XML     113
Architectural Overview     114
X-DOM Overview     115
Loading and Parsing     117
Saving and Serializing     118
Instantiating an X-DOM     118
Functional Construction     119
Specifying Content     120
Automatic Deep Cloning     121
Navigating/Querying an X-DOM     122
Child Node Navigation     122
Parent Navigation     126
Peer Node Navigation     127
Attribute Navigation     128
Updating an X-DOM     128
Simple Value Updates     128
Updating Child Nodes and Attributes     129
Updating Through the Parent     130
Working with Values     133
Setting Values     133
Getting Values     133
Values and Mixed Content Nodes     135
Automatic XText Concatenation     136
Documents and Declarations     136
XDocument     136
XML Declarations     139
Names and Namespaces     140
Specifying Namespaces in the X-DOM     142
The X-DOM and Default Namespaces     143
Prefixes     145
Projecting into an X-DOM     147
Eliminating Empty Elements     149
Streaming a Projection     150
Transforming an X-DOM     151
Index     153
From the B&N Reads Blog

Customer Reviews