示例#1
0
        public void AddNewUser(RegisterUserViewModel userData)
        {
            var user         = userData.ToEntity();
            var passwordSalt = _securityManager.GenerateNewSalt();
            var passwordHash = _securityManager.ComputeHash(passwordSalt, userData.Password);

            user.PasswordSalt = new BsonBinaryData(passwordSalt);
            user.PasswordHash = new BsonBinaryData(passwordHash);
            Users.Insert(user);
        }