Example #1
0
        /// <summary>
        /// Adds a delegate to an action that will be executed on cleanup
        /// </summary>
        /// <param name="action">A delegate to the action to perform</param>
        public void AddCleanupAction(Action action)
        {
            if (_currentState == State.Cleanup)
            {
                throw new InvalidOperationException("Adding cleanup actions from within cleanup is not supported");
            }

            _currentIsolationLevel.AddCleanupAction(action);
        }