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

CreateInvalidOperationException() static private method

static private CreateInvalidOperationException ( TraceSourceType traceSource, string message, Exception innerException ) : Exception
traceSource TraceSourceType
message string
innerException Exception
return Exception
        internal static Exception CreateInvalidOperationException(TraceSourceType traceSource, string message, Exception innerException)
        {
            TransactionsEtwProvider etwLog = TransactionsEtwProvider.Log;
            if (etwLog.IsEnabled())
            {
                etwLog.TransactionExceptionTrace(traceSource, TransactionExceptionType.InvalidOperationException, message, innerException.ToString());
            }

            return new InvalidOperationException(message, innerException);
        }

Same methods

TransactionException::CreateInvalidOperationException ( TraceSourceType traceSource, string message, Exception innerException, Guid distributedTxId ) : Exception

Usage Example

        internal static void DistributedTransactionOutcome(InternalTransaction tx, TransactionStatus status)
        {
            FinalizedObject finalizedObject = null;

            lock (tx)
            {
                if (tx.innerException == null)
                {
                    tx.innerException = tx.PromotedTransaction.InnerException;
                }
                switch (status)
                {
                case TransactionStatus.Committed:
                    tx.State.ChangeStatePromotedCommitted(tx);
                    break;

                case TransactionStatus.Aborted:
                    tx.State.ChangeStatePromotedAborted(tx);
                    break;

                case TransactionStatus.InDoubt:
                    tx.State.InDoubtFromDtc(tx);
                    break;

                default:
                    TransactionException.CreateInvalidOperationException(System.Transactions.SR.GetString("TraceSourceLtm"), "", null);
                    break;
                }
                finalizedObject = tx.finalizedObject;
            }
            if (finalizedObject != null)
            {
                finalizedObject.Dispose();
            }
        }
All Usage Examples Of System.Transactions.TransactionException::CreateInvalidOperationException