Exemplo n.º 1
0
 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());
 }
Exemplo n.º 2
0
 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.");
 }