/// <summary>The do get transaction.</summary>
        /// <returns>The System.Object.</returns>
        protected override object DoGetTransaction()
        {
            var transaction = new ResourcelessTransaction();
            Stack<object> resources;
            if (!TransactionSynchronizationManager.HasResource(this))
            {
                resources = new Stack<object>();
                TransactionSynchronizationManager.BindResource(this, resources);
            }
            else
            {
                var stack = (Stack<object>)TransactionSynchronizationManager.GetResource(this);
                resources = stack;
            }

            resources.Push(transaction);
            return transaction;
        }
Beispiel #2
0
        /// <summary>The do get transaction.</summary>
        /// <returns>The System.Object.</returns>
        protected override object DoGetTransaction()
        {
            var            transaction = new ResourcelessTransaction();
            Stack <object> resources;

            if (!TransactionSynchronizationManager.HasResource(this))
            {
                resources = new Stack <object>();
                TransactionSynchronizationManager.BindResource(this, resources);
            }
            else
            {
                var stack = (Stack <object>)TransactionSynchronizationManager.GetResource(this);
                resources = stack;
            }

            resources.Push(transaction);
            return(transaction);
        }