/// <summary> /// Creates a new bank account. /// </summary> public void CreateBankAccount(string name, int balance) { var account = new CargoBankAccount(_accountIndex, name, balance); _accountsDict.Add(_accountIndex, account); _accountIndex += 1; }
/// <summary> /// Returns whether the account exists, eventually passing the account in the out parameter. /// </summary> public bool TryGetBankAccount(int id, out CargoBankAccount account) { return(_accountsDict.TryGetValue(id, out account)); }