Getting Started
Overview
Lambda Queries
Chaining Query Operators
Composing Lambda Expressions
Lambda expressions and Func signatures
Lambda expressions and element typing
Natural Ordering
Other Operators
Comprehension Queries
Iteration Variables
Query Syntax versus SQL Syntax
Query Syntax versus Lambda Syntax
Mixed Syntax Queries
Deferred Execution
Reevaluation
Outer Variables
How Deferred Execution Works
Chaining Decorators
How Queries Are Executed
Subqueries
Subqueries and Deferred Execution
Composition Strategies
Progressive Query Building
The into Keyword
Scoping rules
Wrapping Queries
Projection Strategies
Object Initializers
Anonymous Types
The let Keyword
Interpreted Queries
How Interpreted Queries Work
Execution
AsEnumerable
LINQ to SQL
LINQ to SQL Entity Classes
DataContext
Automatic Entity Generation
Associations
Deferred Execution with LINQ to SQL
DataLoadOptions
Specifying a filter in advance
Eager loading
Updates
Building Query Expressions
Delegates versus Expression Trees
Compiling expression trees
AsQueryable
Expression Trees
The Expression DOM
Query Operator Overview
Filtering
Where
Comprehension syntax
Indexed filtering
Where in LINQ to SQL
Take and Skip
TakeWhile and SkipWhile
Distinct
Projecting
Select
Comprehension syntax
Indexed projection
Select subqueries and object hierarchies
Subqueries and joins in LINQ to SQL
Projecting into concrete types
SelectMany
Comprehension syntax
Outer iteration variables
Thinking in comprehension syntax
Joining with SelectMany
SelectMany in LINQ to SQL
Outer joins with SelectMany
Joining
Join and GroupJoin
Comprehension syntax
Using Join
Joining on multiple keys
Joining in lambda syntax
Using GroupJoin
Flat outer joins
Joining with lookups
Ordering
OrderBy, OrderByDescending, ThenBy, ThenByDescending
Comprehension syntax
Comparers and collations
IOrderedEnumerable and IOrderedQueryable
Grouping
GroupBy
Comprehension syntax
GroupBy in LINQ to SQL
Grouping by multiple keys
Custom equality comparers
Set Operators
Concat and Union
Intersect and Except
Conversion Methods
OfType and Cast
ToArray, ToList, ToDictionary, ToLookup
AsEnumerable and AsQueryable
Element Operators
First, Last, Single
ElementAt
DefaultIfEmpty
Aggregation Methods
Count and LongCount
Min and Max
Sum and Average
Aggregate
Quantifiers
Contains and Any
All and SequenceEqual
Generation Methods
Empty
Range and Repeat
LINQ to XML
Architectural Overview
X-DOM Overview
Loading and Parsing
Saving and Serializing
Instantiating an X-DOM
Functional Construction
Specifying Content
Automatic Deep Cloning
Navigating/Querying an X-DOM
Child Node Navigation
FirstNode, LastNode, and Nodes
Retrieving elements
Retrieving a single element
Recursive functions
Parent Navigation
Peer Node Navigation
Attribute Navigation
Updating an X-DOM
Simple Value Updates
Updating Child Nodes and Attributes
Updating through the Parent
Removing a sequence of nodes or attributes
Working with Values
Setting Values
Getting Values
Values and Mixed Content Nodes
Automatic XText Concatenation
Documents and Declarations
XDocument
XML Declarations
Names and Namespaces
Specifying Namespaces in the X-DOM
The X-DOM and Default Namespaces
Prefixes
Projecting into an X-DOM
Eliminating Empty Elements
Streaming a Projection
Transforming an X-DOM