Atomia.Provisioning.Modules.Folders.Folders.PrepareAndExecuteCommandsFromList C# (CSharp) Method

PrepareAndExecuteCommandsFromList() private method

Prepares each commands from commands list and execute each commands from the same list. If error occurs during executing one command, Rollback is called.
private PrepareAndExecuteCommandsFromList ( ) : void
return void
        private void PrepareAndExecuteCommandsFromList()
        {
            foreach (ModuleCommand command in this.commands)
            {
                command.Prepare();
            }

            try
            {
                foreach (ModuleCommand command in this.commands)
                {
                    command.Execute();
                }
            }
            catch
            {
                this.RollbackTransaction();
                throw;
            }
        }