In LINQ to SQL, what is the role of DataContext?

  • Executes SQL queries directly on the database
  • Handles data caching and optimization
  • Manages database connection and transaction
  • Maps database entities to CLR objects
The DataContext class in LINQ to SQL is responsible for managing the connection to the database and handling transactions. It acts as a bridge between the database and the LINQ queries, facilitating the mapping of database entities to .NET objects.
Add your answer
Loading...

Leave a comment

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