liquidprojections / LiquidProjections

Liquid Projections supports building and maintaining autonomous .NET projection code in an Event Sourcing architecture.
https://www.liquidprojections.net
MIT License
169 stars 25 forks source link

How should projectors handle hypothetical events which have null key? #44

Open IharBury opened 7 years ago

IharBury commented 7 years ago

Should projectors set up event map to:

dennisdoomen commented 7 years ago

Maybe the EventMap should protect us from that, even before the projector is being called.

IharBury commented 7 years ago

Actually, after reading some documentation, the current behavior of RavenProjector is even more weird. When an event has null key, it will autogenerate a new key for the projection.

dennisdoomen commented 7 years ago

Because that's what RavenDB does of course ;-)

Corniel commented 4 years ago

And how should a projector handle events where the aggregate id is not stored within the event itself, but only in an event envelope?

dennisdoomen commented 4 years ago

And how should a projector handle events where the aggregate id is not stored within the event itself, but only in an event envelope?

The adapter between the specific event store implementation and Liquid Projections must make sure the aggregate ID is written to the Transaction.StreamId property. So the projector itself should not be aware of where the aggregate ID is coming from.