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

GetCurrentTransactionAndScope() static private method

static private GetCurrentTransactionAndScope ( TxLookup defaultLookup, Transaction &current, TransactionScope &currentScope, Transaction &contextTransaction ) : void
defaultLookup TxLookup
current Transaction
currentScope TransactionScope
contextTransaction Transaction
return void
        internal static void GetCurrentTransactionAndScope(
            TxLookup defaultLookup,
            out Transaction current,
            out TransactionScope currentScope,
            out Transaction contextTransaction)
        {
            current = null;
            currentScope = null;
            contextTransaction = null;

            ContextData contextData = ContextData.LookupContextData(defaultLookup);
            if (contextData != null)
            {
                currentScope = contextData.CurrentScope;
                current = FastGetTransaction(currentScope, contextData, out contextTransaction);
            }
        }

Usage Example

 private void CommonInitialize()
 {
     this.complete               = false;
     this.dependentTransaction   = null;
     this.disposed               = false;
     this.committableTransaction = null;
     this.expectedCurrent        = null;
     this.scopeTimer             = null;
     this.scopeThread            = Thread.CurrentThread;
     Transaction.GetCurrentTransactionAndScope(out this.savedCurrent, out this.savedCurrentScope, out this.threadContextData, out this.contextTransaction);
 }
All Usage Examples Of System.Transactions.Transaction::GetCurrentTransactionAndScope