private BaseEvent InternalEndBatch(BatchEvent stack) { BaseEvent processed = ProcessBatch(_currentBatch); if (processed != null) { stack.Push(processed); } _currentBatch = null; return(processed); }
protected internal override BaseEvent Rollback() { var batch = new BatchEvent(); while (Count > 0) { var reverse = Pop().Rollback(); if (reverse == null) { continue; } if (reverse is BatchEvent) { throw new InvalidOperationException("Must not return BatchEvent in Rollback()"); } batch.Push(reverse); } return(batch); }