public void Withdraw(decimal amountToWithdraw) { if (amountToWithdraw > _balance) { throw new OverdraftException(); } _balance -= amountToWithdraw; _feds.Notify(this, amountToWithdraw); }
public void Withdraw(decimal amountToWithdraw) { if (amountToWithdraw > balance) { throw new OverdraftException(); } else { balance -= amountToWithdraw; Feds.Notify(this, amountToWithdraw); // Command "Tell Don't Ask" } }