private void Handle(V1.AccountClosed @event)
        {
            if (State.Value == AccountState.AccountStateEnum.Closed)
            {
                throw new InvalidOperationException("Cannot close an already closed account");
            }

            State = AccountState.CreateClosed();
        }
Beispiel #2
0
        private void Handle(V1.AccountClosed @event)
        {
            var userAccount = UserAccounts.Single(x => x.AccountId == @event.AccountId);

            userAccount = userAccount.FromUserAccountClosed(@event.Amount, @event.CurrencyCode);
        }