Mention what is the role of DataContext classes in LINQ?

Technology CommunityCategory: LINQMention what is the role of DataContext classes in LINQ?
VietMX Staff asked 3 years ago

DataContext class acts as a bridge between SQL Server database and the LINQ to SQL. For accessing the database and also for changing the data in the database, it contains connections string and the functions. Essentially a DataContext class performs the following three tasks:

  • Create connection to database.
  • It submits and retrieves object to database.
  • Converts objects to SQL queries and vice versa.