What is data context class? Explain its role?

Data context class is a LINQ to SQL class that acts as a medium between a SQL server database and LINQ to SQL entities classes mapped to that database. It has following responsibilities:

  1. Contains the connection string information, methods to connect to the database and manipulating the data in the database.
  2. Contains several methods that send updated data from LINQ to SQL entity classes to the database.
  3. Methods can also be mapped to stored procedures and functions.
  4. With data context, we can perform select, insert, update and delete operations over the data in the database.
Tagged , . Bookmark the permalink.

Leave a Reply