public void AddEvents(IEnumerable <object> events) { if (events == null) { throw new ArgumentNullException(nameof(events)); } foreach (var @event in events.Select(x => new ItemWithType(x))) { NewEventsCollection.Add(@event); } currentState = (TState)EventApplier.Apply(stateType, currentState, events.Select(x => new ItemWithType(x))); }
public void AddEvents(object[] events) { if (events == null) { throw new ArgumentNullException(nameof(events)); } for (int i = 0; i < events.Length; i++) { NewEventsCollection.Add(new ItemWithType(events[i])); } currentState = (TState)EventApplier.Apply(stateType, currentState, events.Select(x => new ItemWithType(x))); }
private void AddEventInternal(ItemWithType @event) { NewEventsCollection.Add(@event); currentState = (TState)EventApplier.ApplyEvent(stateType, currentState, @event); }