System.Transactions.TransactionException.CreateEnlistmentStateException C# (CSharp) Method

CreateEnlistmentStateException() static private method

static private CreateEnlistmentStateException ( Exception innerException, Guid distributedTxId ) : Exception
innerException Exception
distributedTxId Guid
return Exception
        internal static Exception CreateEnlistmentStateException(Exception innerException, Guid distributedTxId)
        {
            string messagewithTxId = SR.EnlistmentStateException;
            if (IncludeDistributedTxId(distributedTxId))
                messagewithTxId = string.Format(SR.DistributedTxIDInTransactionException, messagewithTxId, distributedTxId);

            TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
            if (etwLog.IsEnabled())
            {
                etwLog.TransactionExceptionTrace(TransactionExceptionType.InvalidOperationException, messagewithTxId, innerException.ToString());
            }
            return new InvalidOperationException(messagewithTxId, innerException);
        }

Usage Example

 internal virtual byte[] RecoveryInformation(InternalEnlistment enlistment)
 {
     throw TransactionException.CreateEnlistmentStateException(null, enlistment == null ? Guid.Empty : enlistment.DistributedTxId);
 }
All Usage Examples Of System.Transactions.TransactionException::CreateEnlistmentStateException