Skip to content

ITransactionClient.RunTransaction(TransactionOption, Func<Task<bool>>, bool)

RunTransaction(TransactionOption, Func<Task<bool>>, bool)

abstract
public abstract Task RunTransaction(TransactionOption transactionOption, Func<Task<bool>> transactionDelegate, bool useExclusiveLock)
Executes a delegate using the specified transaction option.

Parameters

transactionOptionTransactionOption
The transaction creation, joining, or suppression behavior.
transactionDelegateFunc<Task<bool>>
The delegate to execute. Its result indicates whether the transaction should commit.
useExclusiveLockbool
When true, all transactional states accessed during this transaction will acquire exclusive locks even for read operations, preventing lock upgrade conflicts under high contention.

Returns

A System.Threading.Tasks.Task representing the transaction operation.