public bool CanAddLoan(Loan loan) { //Need unique because this is how the manager ids loans in sending the payments back. return !currentLoans.ContainsKey(loan.GetName()); }
public void AddLoan(Loan newLoan) { if (CanAddLoan(newLoan)) currentLoans.Add(newLoan.GetName(), newLoan); else throw new InvalidOperationException("There is already a loan issued with this name."); }