public bool TryLoadFromSnapshot(Type aggregateRootType, Snapshot snapshot, CommittedEventStream committedEventStream, out Domain.AggregateRoot aggregateRoot) { aggregateRoot = null; if (snapshot == null) return false; if (AggregateSupportsSnapshot(aggregateRootType, snapshot.Payload.GetType())) { try { Log.DebugFormat("Reconstructing aggregate root {0}[{1}] from snapshot", aggregateRootType.FullName, snapshot.EventSourceId.ToString("D")); aggregateRoot = _aggregateRootCreator.CreateAggregateRoot(aggregateRootType); aggregateRoot.InitializeFromSnapshot(snapshot); aggregateRoot.RestoreFromSnapshot(snapshot.Payload); Log.DebugFormat("Applying remaining historic event to reconstructed aggregate root {0}[{1}]", aggregateRootType.FullName, snapshot.EventSourceId.ToString("D")); aggregateRoot.InitializeFromHistory(committedEventStream); } catch (Exception ex) { Log.ErrorFormat("Cannot load snapshot for '{0}' aggregate. {1}", aggregateRoot.GetType().FullName, ex.Message); aggregateRoot = null; return false; } return true; } return false; }