public bool Remove(CheckingAccount checkingAccount) { var account = _checkingAccountRepository.GetById(checkingAccount.Id) ?? throw new NotFoundException(); var removed = _checkingAccountRepository.Remove(checkingAccount); return(removed); }
/// <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); }
public bool Remove(CheckingAccountRemoveCommand cmd) { var account = _checkingAccountRepository.GetById(cmd.Id) ?? throw new NotFoundException(); return(_checkingAccountRepository.Remove(account)); }