-
Notifications
You must be signed in to change notification settings - Fork 92
Description
Hello,
I was looking at the code from the MongoDb and SqlServer EventStore and realized that the GetEvents method of the former returns all events with a sequence number bigger than the snapshot's LastEventSequence, while the later returns all events with sequence number bigger or equal.
SimpleCqrs.EventStore.MongoDb.MongoEventStore:
where domainEvent.Sequence > startSequence
SimpleCqrs.EventStore.SqlServer.SqlStatements:
internal const string GetEventsByAggregateRootAndSequence = "select eventtype, data from {1} where aggregaterootid = '{2}' and sequence >= {3}";
The consequence of this might be that an event handler tries to change the state of the aggregate root which already accounts for this change. Possibly making validation of business rules invalid.
I'm not sure if my interpretation is correct, so I appreciate any feedback on this.
Thank You,
Mathias