The ________ method of the DbContext can be used to commit a transaction.

  • SaveChanges
  • CommitTransaction
  • ExecuteTransaction
  • CompleteTransaction
The correct option is "SaveChanges". In Entity Framework, the SaveChanges method of the DbContext class is used to commit changes made to the entities within the context to the underlying database. When SaveChanges is called, Entity Framework will attempt to save all the pending changes as a single transaction. If the changes are successfully saved, the transaction is committed; otherwise, it will be rolled back.
Add your answer
Loading...

Leave a comment

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