Hello there,
i’m just trying some different approches how to implement some kind of EventStore Repository. I came across the getting-started-with-event-store example (https://github.com/EventStore/getting-started-with-event-store) with the CommonDomain Repository. But I’ve some issues get it work with ES 3.0.3 and EventStore.Client 3.0.2.
9 of 12 Tests are failing with the message: GetEventStoreRepository.AggregateNotFoundException : Aggregate ‘990cd4db-44bd-485b-b2f7-00451bfcd142’ (type TestAggregate) was not found.
What I’ve done so far.
-
Cloned the github repository
-
Updated the nuget package for EventStore.Client
-
Replaced some of the methods with the async versions
-
Run all Tests
GetEventStoreRepository.cs
Old: currentSlice = _eventStoreConnection.ReadStreamEventsForward(streamName, sliceStart, sliceCount, false);
New: currentSlice = _eventStoreConnection.ReadStreamEventsForwardAsync(streamName, sliceStart, sliceCount, false).Result;
_eventStoreConnection.AppendToStream(streamName, expectedVersion, eventsToSave);
_eventStoreConnection.AppendToStreamAsync(streamName, expectedVersion, eventsToSave);
var transaction = _eventStoreConnection.StartTransaction(streamName, expectedVersion);
var transaction = _eventStoreConnection.StartTransactionAsync(streamName, expectedVersion);
transaction.Write(pageEvents);
transaction.Result.WriteAsync(pageEvents);
transaction.Commit();
transaction.Result.CommitAsync();
``
I also made some minor changes to the GetEventStoreRepositoryIntegrationTests.cs
_connection.ConnectAsync().Wait();
_connection.ConnectAsync().Wait();
_connection.DeleteStream(streamName, 11);
_connection.DeleteStreamAsync(streamName, 11);
var read = _connection.ReadStreamEventsForward(string.Format(“aggregate-{0}”, aggregateToSave.Id), 1, 20, false);
var read = _connection.ReadStreamEventsForwardAsync(string.Format(“aggregate-{0}”, aggregateToSave.Id), 1, 20, false).Result;
``
Has anyone else tried to update the example or any suggestions what I’ve missed.
Glad for any help or suggestions!
Best regards Dirk