protected override IEvent[] ExecuteCommand(IEvent[] given, ICommand cmd) { var store = new SingleCommitMemoryStore(); foreach (var e in given.OfType<IFactoryEvent>()) { store.Preload(e.Id.ToString(),e); } new FactoryApplicationService(store, Library).Execute(cmd); return store.Appended ?? new IEvent[0]; }
protected override IEvent[] ExecuteCommand(IEvent[] given, ICommand cmd) { var store = new SingleCommitMemoryStore(); foreach (var e in given.OfType <IFactoryEvent>()) { store.Preload(e.Id.ToString(), e); } new FactoryApplicationService(store, Library).Execute(cmd); return(store.Appended ?? new IEvent[0]); }