Beispiel #1
0
        public void Rollback(Enlistment enlistment)
        {
            foreach (IEntity entity in transactionElements.Keys)
            {
                EnlistmentOperations operation = transactionElements[entity];
                switch (operation)
                {
                case EnlistmentOperations.Add: PersistDeleteEntityAsync(entity as T); break;

                case EnlistmentOperations.Delete: PersistAddEntityAsync(entity as T); break;

                case EnlistmentOperations.Update: PersistUpdateEntityAsync(entity as T); break;
                }
            }
            enlistment.Done();
        }
Beispiel #2
0
        public void Rollback(Enlistment enlistment)
        {
            foreach (IEntity entity in transactionElements.Keys)
            {
                if (entity == null) //doing this for debugging incase I forgot to remove it later.
                {
                }
                EnlistmentOperations operation = transactionElements[entity];
                switch (operation)
                {
                case EnlistmentOperations.Add: PersistDeleteEntityAsync(entity as T); break;

                case EnlistmentOperations.Delete: PersistAddEntityAsync(entity as T); break;

                case EnlistmentOperations.Update: PersistUpdateEntityAsync(entity as T); break;
                }
            }
            enlistment.Done();
        }