Multiple choice technology programming languages

You use a TransactionScope in your application in your application in order to use transaction semantics. What code should you use in order to commit the transaction within the transaction scope?

  1. TransactionScope.Completed = true;

  2. TransactionScope.IsCompleted = true;

  3. TransactionScope.Complete();

  4. TransactionScope.Commit();

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

In .NET, calling the Complete() method on a TransactionScope tells the transaction manager that all operations within the scope completed successfully, committing the transaction when the scope is disposed. Properties like Completed or methods like Commit() do not exist on the TransactionScope class.