TransactionScope Constructor (Transaction^, TimeSpan, TransactionScopeAsyncFlowOption)
[Supported in the .NET Framework 4.5.1 and later versions]
Initializes a new instance of the TransactionScope class with the specified timeout value, and sets the specified transaction as the ambient transaction, so that transactional work done inside the scope uses this transaction.
Assembly: System.Transactions (in System.Transactions.dll)
public:
TransactionScope(
Transaction^ transactionToUse,
TimeSpan scopeTimeout,
TransactionScopeAsyncFlowOption asyncFlowOption
)
Parameters
- transactionToUse
-
Type:
System.Transactions::Transaction^
The transaction to be set as the ambient transaction, so that transactional work done inside the scope uses this transaction.
- scopeTimeout
-
Type:
System::TimeSpan
The TimeSpan after which the transaction scope times out and aborts the transaction.
- asyncFlowOption
-
Type:
System.Transactions::TransactionScopeAsyncFlowOption
An instance of the TransactionScopeAsyncFlowOption enumeration that describes whether the ambient transaction associated with the transaction scope will flow across thread continuations when using Task or async/await .NET async programming patterns.
Available since 4.5.1