I had to make some minor changes to James’s code.
The implementation of Save below doesn’t handle a null parameter for updateHeaders
public void Save(IAggregate aggregate, Guid commitId,
Action<IDictionary<string, object>> updateHeaders)
{
…
if(updateHeaders != null)
updateHeaders(commitHeaders);
…
}
I also don’t understand how the GetById sets the actual aggregate Id. CommonDomain has an abstract factory method. The code I got from somewhere on the web uses a convention for aggregate construction - every aggregate has a private constructor that has one guid parameter. James, how does your implementation set the Id in GetById<>?
Ok so now using https://github.com/EventStore/getting-started-with-event-store/tree/WithoutStreamCreated
This version fixed the WrongExpectedVersion https://github.com/EventStore/getting-started-with-event-store/tree/WithoutStreamCreated
But now I’m getting an error in DeserializeEvent when reading from the eventstore.
Error reading JObject from JsonReader. Path ‘’, line 0, position 0.