Table of Contents

Copyright

Brief Table of Contents

Table of Contents

Foreword

Preface

Acknowledgments

About This Book

1. Getting started

Chapter 1. Introducing LINQ

1.1. What is LINQ?

1.1.1. Overview

1.1.2. LINQ as a toolset

1.1.3. LINQ as language extensions

1.2. Why do we need LINQ?

1.2.1. Common problems

1.2.2. Addressing a paradigm mismatch

1.2.3. LINQ to the rescue

1.3. Design goals and origins of LINQ

1.3.1. The goals of the LINQ project

1.3.2. A bit of history

1.4. First steps with LINQ to Objects: Querying collections in memory

1.4.1. What you need to get started

1.4.2. Hello LINQ to Objects

1.5. First steps with LINQ to XML: Querying XML documents

1.5.1. Why we need LINQ to XML

1.5.2. Hello LINQ to XML

1.6. First steps with LINQ to SQL: Querying relational databases

1.6.1. Overview of LINQ to SQL’s features

1.6.2. Hello LINQ to SQL

1.6.3. A closer look at LINQ to SQL

1.7. Summary

Chapter 2. C# and VB.NET language enhancements

2.1. Discovering the new language enhancements

2.1.1. Generating a list of running processes

2.1.2. Grouping results into a class

2.2. Implicitly typed local variables

2.2.1. Syntax

2.2.2. Improving our example using implicitly typed local variables

2.3. Object and collection initializers

2.3.1. The need for object initializers

2.3.2. Collection initializers

2.3.3. Improving our example using an object initializer

2.4. Lambda expressions

2.4.1. A refresher on delegates

2.4.2. Anonymous methods

2.4.3. Introducing lambda expressions

2.5. Extension methods

2.5.1. Creating a sample extension method

2.5.2. More examples using LINQ’s standard query operators

2.5.3. Extension methods in action in our example

2.5.4. Warnings

2.6. Anonymous types

2.6.1. Using anonymous types to group data into an object

2.6.2. Types without names, but types nonetheless

2.6.3. Improving our example using anonymous types

2.6.4. Limitations

2.7. Summary

Chapter 3. LINQ building blocks

3.1. How LINQ extends .NET

3.1.1. Refresher on the language extensions

3.1.2. The key elements of the LINQ foundation

3.2. Introducing sequences

3.2.1. IEnumerable<T>

3.2.2. Refresher on iterators

3.2.3. Deferred query execution

3.3. Introducing query operators

3.3.1. What makes a query operator?

3.3.2. The standard query operators

3.4. Introducing query expressions

3.4.1. What is a query expression?

3.4.2. Writing query expressions

3.4.3. How the standard query operators relate to query expressions

3.4.4. Limitations

3.5. Introducing expression trees

3.5.1. Return of the lambda expressions

3.5.2. What are expression trees?

3.5.3. IQueryable, deferred query execution redux

3.6. LINQ DLLs and namespaces

3.7. Summary

2. Querying objects in memory

Chapter 4. Getting familiar with LINQ to Objects

4.1. Introducing our running example

4.1.1. Goals

4.1.2. Features

4.1.3. The business entities

4.1.4. Database schema

4.1.5. Sample data

4.2. Using LINQ with in-memory collections

4.2.1. What can we query?

4.2.2. Supported operations

4.3. Using LINQ with ASP.NET and Windows Forms

4.3.1. Data binding for web applications

4.3.2. Data binding for Windows Forms applications

4.4. Focus on major standard query operators

4.4.1. Where, the restriction operator

4.4.2. Using projection operators

4.4.3. Using Distinct

4.4.4. Using conversion operators

4.4.5. Using aggregate operators

4.5. Creating views on an object graph in memory

4.5.1. Sorting

4.5.2. Nested queries

4.5.3. Grouping

4.5.4. Using joins

4.5.5. Partitioning

4.6. Summary

Chapter 5. Beyond basic in-memory queries

5.1. Common scenarios

5.1.1. Querying nongeneric collections

5.1.2. Grouping by multiple criteria

5.1.3. Dynamic queries

5.1.4. LINQ to Text Files

5.2. Design patterns

5.2.1. The Functional Construction pattern

5.2.2. The ForEach pattern

5.3. Performance considerations

5.3.1. Favor a streaming approach

5.3.2. Be careful about immediate execution

5.3.3. Will LINQ to Objects hurt the performance of my code?

5.3.4. Getting an idea about the overhead of LINQ to Objects

5.3.5. Performance versus conciseness: A cruel dilemma?

5.4. Summary

3. Querying relational data

Chapter 6. Getting started with LINQ to SQL

6.1. Jump into LINQ to SQL

6.1.1. Setting up the object mapping

6.1.2. Setting up the DataContext

6.2. Reading data with LINQ to SQL

6.3. Refining our queries

6.3.1. Filtering

6.3.2. Sorting and grouping

6.3.3. Aggregation

6.3.4. Joining

6.4. Working with object trees

6.5. When is my data loaded and why does it matter?

6.5.1. Lazy loading

6.5.2. Loading details immediately

6.6. Updating data

6.7. Summary

Chapter 7. Peeking under the covers of LINQ to SQL

7.1. Mapping objects to relational data

7.1.1. Using inline attributes

7.1.2. Mapping with external XML files

7.1.3. Using the SqlMetal tool

7.1.4. The LINQ to SQL Designer

7.2. Translating query expressions to SQL

7.2.1. IQueryable

7.2.2. Expression trees

7.3. The entity life cycle

7.3.1. Tracking changes

7.3.2. Submitting changes

7.3.3. Working with disconnected data

7.4. Summary

Chapter 8. Advanced LINQ to SQL features

8.1. Handling simultaneous changes

8.1.1. Pessimistic concurrency

8.1.2. Optimistic concurrency

8.1.3. Handling concurrency exceptions

8.1.4. Resolving conflicts using transactions

8.2. Advanced database capabilities

8.2.1. SQL pass-through: Returning objects from SQL queries

8.2.2. Working with stored procedures

8.2.3. User-defined functions

8.3. Improving the business tier

8.3.1. Compiled queries

8.3.2. Partial classes for custom business logic

8.3.3. Taking advantage of partial methods

8.3.4. Using object inheritance

8.4. A brief diversion into LINQ to Entities

8.5. Summary

4. Manipulating XML

Chapter 9. Introducing LINQ to XML

9.1. What is an XML API?

9.2. Why do we need another XML programming API?

9.3. LINQ to XML design principles

9.3.1. Key concept: functional construction

9.3.2. Key concept: context-free XML creation

9.3.3. Key concept: simplified names

9.4. LINQ to XML class hierarchy

9.5. Working with XML using LINQ

9.5.1. Loading XML

9.5.2. Parsing XML

9.5.3. Creating XML

9.5.4. Creating XML with Visual Basic XML literals

9.5.5. Creating XML documents

9.5.6. Adding content to XML

9.5.7. Removing content from XML

9.5.8. Updating XML content

9.5.9. Working with attributes

9.5.10. Saving XML

9.6. Summary

Chapter 10. Query and transform XML with LINQ to XML

10.1. LINQ to XML axis methods

10.1.1. Element

10.1.2. Attribute

10.1.3. Elements

10.1.4. Descendants

10.1.5. Ancestors

10.1.6. ElementsAfterSelf, NodesAfterSelf, ElementsBeforeSelf, and NodesBeforeSelf

10.1.7. Visual Basic XML axis properties

10.2. Standard query operators

10.2.1. Projecting with Select

10.2.2. Filtering with Where

10.2.3. Ordering and grouping

10.3. Querying LINQ to XML objects with XPath

10.4. Transforming XML

10.4.1. LINQ to XML transformations

10.4.2. Transforming LINQ to XML objects with XSLT

10.5. Summary

Chapter 11. Common LINQ to XML scenarios

11.1. Building objects from XML

11.1.1. Goal

11.1.2. Implementation

11.2. Creating XML from object graphs

11.2.1. Goal

11.2.2. Implementation

11.3. Creating XML with data from a database

11.3.1. Goal

11.3.2. Implementation

11.4. Filtering and mixing data from a database with XML data

11.4.1. Goal

11.4.2. Implementation

11.5. Reading XML and updating a database

11.5.1. Goal

11.5.2. Implementation

11.6. Transforming text files into XML

11.6.1. Goal

11.6.2. Implementation

11.7. Summary

5. LINQing it all together

Chapter 12. Extending LINQ

12.1. Discovering LINQ’s extension mechanisms

12.1.1. How the LINQ flavors are LINQ implementations

12.1.2. What can be done with custom LINQ extensions

12.2. Creating custom query operators

12.2.1. Improving the standard query operators

12.2.2. Utility or domain-specific query operators

12.3. Custom implementations of the basic query operators

12.3.1. Refresh on the query translation mechanism

12.3.2. Query expression pattern specification

12.3.3. Example 1: tracing standard query operators’ execution

12.3.4. Limitation: query expression collision

12.3.5. Example 2: nongeneric, domain-specific operators

12.3.6. Example 3: non-sequence operator

12.4. Querying a web service: LINQ to Amazon

12.4.1. Introducing LINQ to Amazon

12.4.2. Requirements

12.4.3. Implementation

12.5. IQueryable and IQueryProvider: LINQ to Amazon advanced edition

12.5.1. The IQueryable and IQueryProvider interfaces

12.5.2. Implementation

12.5.3. What happens exactly

12.6. Summary

Chapter 13. LINQ in every layer

13.1. Overview of the LinqBooks application

13.1.1. Features

13.1.2. Overview of the UI

13.1.3. The data model

13.2. LINQ to SQL and the data access layer

13.2.1. Refresher on the traditional three-tier architecture

13.2.2. Do we need a separate data access layer or is LINQ to SQL enough?

13.2.3. Sample uses of LINQ to SQL in LinqBooks

13.3. Use of LINQ to XML

13.3.1. Importing data from Amazon

13.3.2. Generating RSS feeds

13.4. Use of LINQ to DataSet

13.5. Using LINQ to Objects

13.6. Extensibility

13.6.1. Custom query operators

13.6.2. Creating and using a custom LINQ provider

13.7. A look into the future

13.7.1. Custom LINQ flavors

13.7.2. LINQ to XSD, the typed LINQ to XML

13.7.3. PLINQ: LINQ meets parallel computing

13.7.4. LINQ to Entities, a LINQ interface for the ADO.NET Entity Framework

13.8. Summary

Appendix The standard query operators

Filtering

Projection

Partitioning

Join

Concatenation

Sorting

Grouping

Set

Conversion

Equality

Element

Generation

Quantifiers

Aggregation

Appendix Resources

LINQ in Action resources

Microsoft resources

Community resources

Blogs

Others

Appendix LINQ in Action

Index

List of Figures

List of Tables

List of Listings

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.37.254