When event sourcing is implemented, the appended events are often stored in a collection in a base Aggregate class. This is explained in this blog post: https://lostechies.com/jimmybogard/2014/05/13/a-better-domain-events-pattern/
Example: https://github.com/yreynhout/AggregateSource/blob/master/src/Core/AggregateSource.Content.ExplicitRouting/AggregateRootEntity.cs
This enables that the events can be appended to the store before a transactions is completed.
( See SaveChanged https://lostechies.com/jimmybogard/2014/05/13/a-better-domain-events-pattern/ )
This is difficult in the case of aggregates because the Marten session does not contain the aggregates. Is this something we can support too? We might hold the aggregates in a separated collection, so that we can enumerate them in a listener.
Or do you have something else in in mind to append events to the session in an automatic way?
When event sourcing is implemented, the appended events are often stored in a collection in a base Aggregate class. This is explained in this blog post: https://lostechies.com/jimmybogard/2014/05/13/a-better-domain-events-pattern/
Example: https://github.com/yreynhout/AggregateSource/blob/master/src/Core/AggregateSource.Content.ExplicitRouting/AggregateRootEntity.cs
This enables that the events can be appended to the store before a transactions is completed.
( See SaveChanged https://lostechies.com/jimmybogard/2014/05/13/a-better-domain-events-pattern/ )
This is difficult in the case of aggregates because the Marten session does not contain the aggregates. Is this something we can support too? We might hold the aggregates in a separated collection, so that we can enumerate them in a listener.
Or do you have something else in in mind to append events to the session in an automatic way?