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 ...

See more details below
LINQ Pocket Reference

Available on NOOK devices and apps  
  • NOOK Devices
  • NOOK HD/HD+ Tablet
  • NOOK
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac
  • NOOK Study
  • NOOK for Web

Want a NOOK? Explore Now

NOOK Book (eBook)
$10.49
BN.com price
(Save 12%)$11.99 List Price

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

Read More Show Less

Product Details

  • ISBN-13: 9781449370411
  • Publisher: O'Reilly Media, Incorporated
  • Publication date: 2/26/2008
  • Series: Pocket Reference (O'Reilly)
  • Sold by: Barnes & Noble
  • Format: eBook
  • Edition number: 1
  • Pages: 174
  • Sales rank: 643,080
  • File size: 3 MB

Meet 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.

Read More Show Less

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
Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)