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

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

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