How should projectors handle hypothetical events which have null key?
Should projectors set up event map to:
- Throw when an event has null key
- Skip events with null key
- Project all events with null key to a special projection with null key (current behavior for RavenDB but not possible for NHibernate) ?
Maybe the EventMap should protect us from that, even before the projector is being called.
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.
Because that's what RavenDB does of course ;-)
And how should a projector handle events where the aggregate id is not stored within the event itself, but only in an event envelope?
And how should a projector handle events where the
aggregate idis 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.