System.Transactions.Transaction.Clone C# (CSharp) Method

Clone() public method

public Clone ( ) : Transaction
return Transaction
        public Transaction Clone()
        {
            TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
            if (etwLog.IsEnabled())
            {
                etwLog.MethodEnter(TraceSourceType.TraceSourceLtm, this);
            }

            if (Disposed)
            {
                throw new ObjectDisposedException(nameof(Transaction));
            }

            if (_complete)
            {
                throw TransactionException.CreateTransactionCompletedException(DistributedTxId);
            }

            Transaction clone = InternalClone();

            if (etwLog.IsEnabled())
            {
                etwLog.MethodExit(TraceSourceType.TraceSourceLtm, this);
            }
            return clone;
        }

Same methods

Transaction::Clone ( ) : System.Transactions.Transaction

Usage Example

        public TransactionContext(WorkflowServiceInstance durableInstance, Transaction currentTransaction)
        {
            Fx.Assert(durableInstance != null, "Null DurableInstance passed to TransactionContext.");
            Fx.Assert(currentTransaction != null, "Null Transaction passed to TransactionContext.");

            this.currentTransaction = currentTransaction.Clone();
            this.durableInstance = durableInstance;
            this.currentTransaction.EnlistVolatile(this, EnlistmentOptions.EnlistDuringPrepareRequired);
        }
All Usage Examples Of System.Transactions.Transaction::Clone