You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The preferred way to do publishing is to let the EventStore do it. As you can see, the repository constructor with a publisher is marked obsolete, and should be avoided.
The reason to let the eventstore do the publishing is that in a real world scenario you would often send the events on a bus or save them in a different data store than the event store. You would then need distributed transactions to make sure events aren't saved and not published or the other way around. To avoid this problem, let the eventstore publish the events after they are written to disk.
Hello, I am still learning event sourcing and trying examples out to get more deeper understanding.
Based on your Sample, I am confused why is Publish need to be called twice? On your Repository.cs
_eventStore.Save<T>(changes);
Calls Publish from InMemoryEventStore class, then after that it calls Publish again on:Does InMemoryEventStore need Publish? Since Repository handles that?
The text was updated successfully, but these errors were encountered: