In LINQ to SQL, what is the purpose of the DataContext class?

  • It is responsible for executing stored procedures and user-defined functions
  • It is used to define the relationships between database tables
  • It is used to define the structure of the database tables
  • It provides a connection to the database and translates LINQ queries into SQL commands
The DataContext class in LINQ to SQL acts as a bridge between the application and the database. It manages database connections and translates LINQ queries into SQL commands, facilitating data retrieval, manipulation, and other operations. It also provides transaction support and change tracking capabilities, making it easier to work with database entities.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *