public static void Invoke(Action action)
        {
            Transaction transaction = Transaction.Current;
            if (transaction == null)
            {
                throw new InvalidOperationException("No active transaction in scope");
            }

            var handler = new OnTransactionCommittingHandler(action);
            transaction.EnlistVolatile(handler, EnlistmentOptions.None);
        }
Example #2
0
        public static void Invoke(Action action)
        {
            Transaction transaction = Transaction.Current;

            if (transaction == null)
            {
                throw new InvalidOperationException("No active transaction in scope");
            }

            var handler = new OnTransactionCommittingHandler(action);

            transaction.EnlistVolatile(handler, EnlistmentOptions.None);
        }