Load aggreagate in a specified version


Is it possible to load an aggregate as of given version (read only)?
I’d like to do something like Repository.load(id, version) but get an aggregate instead of Exception.

If not, how would you load a historic version of an aggregate?

Regards, Kamil

Hi Kamil,

What do you need the historic version for?
If you really need it, you’ll have to construct an instance yourself using a DomainEventStream. Stop streaming event when the desired timestamp/event is reached.



Hi Allard,
I need it for something like showing purchase history with past prices and so on.
So one option is specialization of an EventSourcingRepository. I guess the other would be creating dedicated read model.
Do you then recommend option 1?

W dniu środa, 28 października 2015 20:53:28 UTC+1 użytkownik Allard Buijze napisał:

“showing purchase history”… sounds like a query to me.
My recommended option is to use a query model for queries