private void CreateUser(RegistrationInput input) { var passwordHash = BCrypt.Net.BCrypt.HashPassword(input.Password); var author = new Author(input.Username, passwordHash, input.Alias); context.Authors.Add(author); context.SaveChanges(); }
internal void Display() { var input = new RegistrationInput(); Console.WriteLine("Please enter a username"); input.Username = ValidateInput(ValidateUsername); CheckIfUnique = null; Console.WriteLine("Please enter a password"); input.Password = ValidateInput(ValidatePassword, true); Console.WriteLine("Please enter an alias"); input.Alias = ValidateInput(ValidateAlias); RegisterUserCallback(input); WaitForKeyPress(); NextView(); }