linkTo from C#

I have a use case where I would like to write linkTo events from C# code. Is it simply a matter of https://github.com/EventStore/EventStore/blob/master/src/EventStore.Core.Tests/ClientAPI/SpecificationWithLinkToToMaxCountDeletedEvents.cs#L26 or is it more involved? If I add metadata to this event (I would need to put a checkpoint in there), where does it show up? OriginalEvent?

Drop me a note offline I’m doing this in competing and can explain more

Hi Greg and João,

Did you come to any conclusions on how to write linkTo events from C# code? I have a use case that would make use of this feature.

Thanks,

Anne

Yes if you look at messageparker under persistent subbscripion service it even does it. Im on phone will link later

Sorry for the delay I am at a computer now and can give you a direct link.

A linkTo is just a special type of event "$>"

Here is some code to help you out

https://github.com/EventStore/EventStore/blob/dev/src/EventStore.Core/Services/PersistentSubscription/PersistentSubscriptionMessageParker.cs#L50

Also note the event type must be SystemEventTypes.LinkTo

https://github.com/EventStore/EventStore/blob/f0e38e85aa473b7b4c57f1e413661da86e828e31/src/EventStore.ClientAPI/Common/SystemNames.cs#L47

@all we might want to expose SystemNames to the Client API?

Cheers,

Greg

I just added a PR to make SystemEventTypes public so you can use it in future versions.

Not that we are likely to change it but probably best to use the constant :slight_smile:

This is great - thank you!

When will SystemEventTypes be public?

Thanks,

Anne

It is in dev i believe now