Exemplo n.º 1
0
        public void RaiseTransactionRollingBackEvent(ReadOnlyCollection <DomainObject> domainObjects)
        {
            ArgumentUtility.CheckNotNull("domainObjects", domainObjects);

            _listenerCollection.TransactionRollingBack(_clientTransaction, domainObjects);
            _extensionCollection.RollingBack(_clientTransaction, domainObjects);

            using (EnterScopeOnDemand())
            {
                _clientTransaction.OnRollingBack(new ClientTransactionEventArgs(domainObjects));
                // ReSharper disable ForCanBeConvertedToForeach
                for (int i = 0; i < domainObjects.Count; i++)
                {
                    var domainObject = domainObjects[i];
                    if (domainObject.State != StateType.Invalid)
                    {
                        domainObject.OnRollingBack(EventArgs.Empty);
                    }
                }
                // ReSharper restore ForCanBeConvertedToForeach
            }
        }