I am struggling with the same, I think the short answer is:
If you do not use snapshots, the implementation in the test project will work fine. In fact, I would add some code to throw an exception if you were given a snapshot.
If you use snapshots, you will need to use an approach similar to the one described at the end of the one described here: http://williamverdolini.imtqy.com/2014/08/20/cqrses-neventstore-snapshots/
In fact, the problem is that the object that you will return from IConstructAggregates will play a stream of events on it , starting with the version immediately after the snapshot that is passed to .
Just guessing, but I think the reason this cannot be βofficiallyβ implemented in CommonDomain is:
If you have aggregate files that support snapshots, you still need to implement GetSnapshot() , and you want to build an IConstructAggregates implementation that can somehow moisten these aggregates (maybe the ISupportSnapshots interface?)
You might want to use your DI container to create your aggregate, not just Activator.CreateInstance<T>() .
It looks like this piece of code uses the same logic as the AggregateFactory from the test project: - http://pastebin.com/cFESMiTz
source share