The DataContext Class

It is the DataContext class that handles your connection to the database. It also handles database queries, updates, inserts, identity tracking, change tracking, change processing, transactional integrity, and even database creation.

The DataContext class translates your queries of entity classes into SQL statements that are performed on the connected database.

Deriving [Your]DataContext class from the DataContext class gives [Your]DataContext class access to a host of common database methods, such as ExecuteQuery, ExecuteCommand, and SubmitChanges. In addition to these inherited methods, [Your]DataContext class will contain properties of type System.Data.Linq.Table<T> for each table and view in the database for which you ...

Get Pro LINQ: Language Integrated Query in C# 2008 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.