public IAggregateRoot Get(Type aggregateRootType, string aggregateRootId) { if (aggregateRootId == null) { throw new ArgumentNullException("aggregateRootId"); } var aggregateRoot = default(IAggregateRoot); CompatibleStyle compatibleStyle = CompatibleStyle.EventSourcingOnly; ICompatibleStoreHandler aggregateInitEventHandler = _compatibleStoreHandlerProvider.GetHandler(aggregateRootType); if (aggregateInitEventHandler != null) { compatibleStyle = aggregateInitEventHandler.GetCompatibleStyle(); } if (compatibleStyle == CompatibleStyle.EventSourcingOnly) { if (TryGetFromSnapshot(aggregateRootId, aggregateRootType, out aggregateRoot)) { return(aggregateRoot); } } if (TryGetFromCompatibleAggregateStore(aggregateRootId, aggregateRootType, aggregateInitEventHandler, compatibleStyle, out aggregateRoot)) { return(aggregateRoot); } return(null); }
public CompatibleStyle GetCompatibleStyle() { return(_aggregateInitEvent.GetCompatibleStyle(null)); }