コード例 #1
0
ファイル: Controller.cs プロジェクト: gissavem/GuestbookApp
        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();
        }
コード例 #2
0
        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();
        }