Handle all Events for an aggregate

后端 未结 1 615
旧时难觅i
旧时难觅i 2021-01-22 04:12

Please see my first Persistent Subscription below:

 namespace PersistentSubscription
    {
        internal class Program
        {
            private static vo         


        
1条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-22 04:40

    This question helped me: Using the Event Store Client API (.NET), how to I write to a stream and link one event to another?

    I simply had to change this:

    PersistentSubscriptionSettings settings = PersistentSubscriptionSettings.Create()
                    .DoNotResolveLinkTos() //Specifically this line
                    .StartFromCurrent();
    

    to this:

    PersistentSubscriptionSettings settings = PersistentSubscriptionSettings.Create()
                    .ResolveLinkTos() //Specifically this line
                    .StartFromCurrent();
    

    DoNotResolveLinkTos gets a link to the original event, whereas ResolveLinkTos gets the actual event itself. Therefore I was trying to deserialize the link object, which was causing the exception.

    0 讨论(0)
提交回复
热议问题