Example #1
0
        public MappedOperation MapOperation(Type operationType)
        {
            if (_mappedOperations[_nextAvailableId] != null)
                throw new InvalidOperationException($"Failed to map operation '{operationType}', an operation is already mapped to id {_nextAvailableId}");

            var mappedEvent = new MappedOperation {Id = _nextAvailableId, OperationType = operationType};
            _mappedOperations[_nextAvailableId++] = mappedEvent;

            return mappedEvent;
        }
Example #2
0
        public MappedOperation MapOperation(Type operationType)
        {
            if (_mappedOperations[_nextAvailableId] != null)
            {
                throw new InvalidOperationException($"Failed to map operation '{operationType}', an operation is already mapped to id {_nextAvailableId}");
            }

            var mappedEvent = new MappedOperation {
                Id = _nextAvailableId, OperationType = operationType
            };

            _mappedOperations[_nextAvailableId++] = mappedEvent;

            return(mappedEvent);
        }