public ulong AddAccountToClient(ulong clientId, AccountCreator accountCreator) { var account = accountCreator.CreateAccount(Id, clientId); if (Accounts.ContainsValue(account)) { throw new AccountAlreadyRegisteredException(); } Accounts.Add(_nextAccountId, account); Clients[clientId].AddAccount(_nextAccountId, account); return(_nextAccountId++); }
public ulong AddAccountToClient(ulong bankId, ulong clientId, AccountCreator accountCreator) { return(_registeredBanks[bankId].AddAccountToClient(clientId, accountCreator)); }