private void Handle(V1.AccountClosed @event) { if (State.Value == AccountState.AccountStateEnum.Closed) { throw new InvalidOperationException("Cannot close an already closed account"); } State = AccountState.CreateClosed(); }
private void Handle(V1.AccountClosed @event) { var userAccount = UserAccounts.Single(x => x.AccountId == @event.AccountId); userAccount = userAccount.FromUserAccountClosed(@event.Amount, @event.CurrencyCode); }