gautema / CQRSlite

A lightweight framework to help creating CQRS and Eventsourcing applications in C#
Other
1.1k stars 266 forks source link

Error EventIdIncorrectException in the new version #102

Closed DanBrk closed 2 years ago

DanBrk commented 4 years ago

After I upgraded to latest version, I receive EventIdIncorrectException from AggregateRoot.FlushUncommittedChanges(). It means that Event.Id must be equal to Aggregate.Id . My EventStore database is organized a little bit different. The event.id is unique and the key is event.AggregateId+event.Version.

Why is it important to have Event.Id=Aggregate.Id ?

Thanks.

gautema commented 4 years ago

It's not really important, it was just a design decision taken a long time ago. If I could do it again I probably would have created a field named aggregateId or similar to store the id in. I'm sorry if this doesn't work out for you, and hope you can find a way around it to make it work.

DanBrk commented 4 years ago

Thanks for the response.