I have set up Event Store, and can happily write events to the stream, subscribe, and read historical events, that all works fine.
I can see that in the ResolvedEvent
that gets passed to my subscription handler method has a Link
property, but I'm wondering how, when I write to the stream, do I 'set' this property?
I've tried setting various meta data properties (using JSON notation), looking through the source code, but didn't find anything that works.
It is possible that I'm going about this the wrong way, and what I'm trying to do (write an event to a stream, and then link a second event to the first so I can find the 'reply' later on) should be done another way.
I do not think that Link is what you think it means? (unless you can quote something from a documentation that is what it is in fact supposed to do)
That Link is used for Projections that are created from various other streams.
For example:
When you enable all the projections in EvenStore you will get a Group projection that runs out of the box. This projection works by grouping streams by a naming conventions of "group-id"
Think of saving several aggregates to their own streams
That is great, but how do you then subscribe to any events that happens to any of those stream. This is where the build in group projection comes to work
You subscribe to the $ce-customer stream, which is a projection.
When you actually read that projection all you will get is the link to the original event. This is the LINK that I am talking about and maybe you confusing with.
So you know that option in the .NET client resolveLinkTos
Task<EventReadResult> ReadEventAsync(string stream, long eventNumber, bool resolveLinkTos);
If you set that to true
on resolveLinkTos
then the original events will come back in the stream data (not just the links to the original events).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With