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

SetDistributedTransactionIdentifier() public method

public SetDistributedTransactionIdentifier ( IPromotableSinglePhaseNotification promotableNotification, Guid distributedTransactionIdentifier ) : void
promotableNotification IPromotableSinglePhaseNotification
distributedTransactionIdentifier Guid
return void
        public void SetDistributedTransactionIdentifier(IPromotableSinglePhaseNotification promotableNotification,
                                                        Guid distributedTransactionIdentifier)
        {
            TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
            if (etwLog.IsEnabled())
            {
                etwLog.MethodEnter(TraceSourceType.TraceSourceLtm, this);
            }

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

            if (promotableNotification == null)
            {
                throw new ArgumentNullException(nameof(promotableNotification));
            }

            if (distributedTransactionIdentifier == Guid.Empty)
            {
                throw new ArgumentException(null, nameof(distributedTransactionIdentifier));
            }

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

            lock (_internalTransaction)
            {
                _internalTransaction.State.SetDistributedTransactionId(_internalTransaction,
                    promotableNotification,
                    distributedTransactionIdentifier);

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

Same methods

Transaction::SetDistributedTransactionIdentifier ( System promotableNotification, System distributedTransactionIdentifier ) : void