public LoginResult Login(string userName, string password, out BankUser bankUser) { bankUser = null; if (users.TryGetValue(userName, out BankUser user)) { if (user.Credentials.IsPasswordCorect(password)) { bankUser = user; return(LoginResult.Sucess); } else { return(LoginResult.InvalidPassword); } } return(LoginResult.InvalidUser); }
public bool AddNewUser(BankUser user) { return(users.TryAdd(user.Credentials.UserName, user)); }