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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.