O'Reilly logo

Pro LINQ: Language Integrated Query in C# 2008 by Joseph C. Rattz Jr.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required