Exemple #1
0
        public bool Remove(CheckingAccount checkingAccount)
        {
            var account = _checkingAccountRepository.GetById(checkingAccount.Id) ?? throw new NotFoundException();

            var removed = _checkingAccountRepository.Remove(checkingAccount);

            return(removed);
        }
Exemple #2
0
        /// <summary>
        /// Delete a account
        /// </summary>
        /// <param name="id">index</param>
        public void Delete(int id)
        {
            if (id == 0)
            {
                throw new ArgumentException("The Id can not be zero.");
            }

            _repository.Remove(id);
        }
Exemple #3
0
        public bool Remove(CheckingAccountRemoveCommand cmd)
        {
            var account = _checkingAccountRepository.GetById(cmd.Id) ?? throw new NotFoundException();

            return(_checkingAccountRepository.Remove(account));
        }