Skip to content

AggregateRoot not Loading when publishing command #960

Discussion options

You must be logged in to vote

Ok. I solved this. I wrote a custom EventStore provider for CosmosDB which appeared to be working as expected and in fact was with the exception of one small thing.

public async Task<IReadOnlyCollection<ICommittedDomainEvent>> LoadCommittedEventsAsync(IIdentity id, int fromEventSequenceNumber, CancellationToken cancellationToken)
        {
            var events = new List<EventData>();

            var query = $"SELECT * FROM c WHERE c.StreamId = '{id.Value}'";
            await((IAdvancedEventStore)_eventStore).LoadEvents(query, e =>
            {
                events.AddRange(e.Where(x => (int)x.Version >= fromEventSequenceNumber));
                return Task.CompletedTask;
        …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@jessemillerrev
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by jessemillerrev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants