public static string SimulateUserCreation() { Console.WriteLine("Let's first test the password hash creation, i.e. user creation..."); Console.WriteLine("Please enter user ID: "); string userid = Console.ReadLine(); Console.WriteLine("Please enter password: "); string password = Console.ReadLine(); string salt = null; string passwordHash = pwdManager.GeneratePasswordHash(password, out salt); // Let's save the values in the database User user = new User { UserId = userid, PasswordHash = passwordHash, Salt = salt }; // Let's add the user to the database userRepo.AddUser(user); return salt; }
// Function to add the user in the dummy DB in memory public void AddUser(User user) { users.Add(user); }