AggregateRoot not Loading when publishing command #960
-
Hello, I am sure I am doing something wrong but I cannot for the life of me get my AggregateRoot object to load from the event store when publishing a new command by hand. EX.
The Entity loads in fine but when the command handler triggers the aggregate root is marked as new and no data was loaded into state. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Make sure that the identifier of the aggregate is the same, if it recognizes the aggregate as new it is mainly because the entity.FeasibilityRequestDetailId must be changing the value and it must not be the same. |
Beta Was this translation helpful? Give feedback.
-
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.
My code was checking for events whose x.Version was > fromEventSequenceNumber instead of >=. Once I followed it all the way through and I saw that the id's were correct but the events were not being returned in that lookup I saw that it is counting from 1 and my first event version number is 1 so it was never returning it. This problem had me stuck for far too long! |
Beta Was this translation helpful? Give feedback.
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.