private bool Execute(ReceiveMoneyCommand command) { var moneyReceived = new MoneyReceivedEvent(command.Transaction); Emit(moneyReceived); return(true); }
public bool Handle(IDomainEvent <Account, AccountId, MoneySentEvent> domainEvent) { var isNewSpec = new AggregateIsNewSpecification(); if (isNewSpec.IsSatisfiedBy(this)) { var command = new ReceiveMoneyCommand( domainEvent.AggregateEvent.Transaction.Receiver, domainEvent.AggregateEvent.Transaction); AccountAggregateManager.Tell(command); Emit(new MoneyTransferStartedEvent(domainEvent.AggregateEvent.Transaction)); } return(true); }