2.1. Introduction

In Chapter 1 we focused on the standard query operators, looking closely at each method for querying and modifying objects. You now know everything needed to query any data source. Whether data sources are in-memory objects, relational databases, or XML, we use the same uniform syntax to query them. An object is queryable as long as it implements the IQueryable<T> or IEnumerable<T> interface.

LINQ to SQL implements the IQueryable<T> interface to convert query expressions into Expression trees, which it transforms into SQL statements.

Results are stored using a basic ORM model, so rows are placed in objects created in our code. The LINQ to SQL run-time infrastructure can track each change to our objects. To persist changes, we call a method, and every tracked change will be propagated to the database.

LINQ to SQL is compatible with ADO.NET 2.0 classes such as Connection and DataSet. You can easily integrate LINQ to SQL with existing ADO.NET programs; hence this chapter's title.

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

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