コード例 #1
0
        public void Register(string userName, string password, int studentId)
        {
            var hashedPassword = HashPasswordService.Hash(password);
            var sql            = $"INSERT INTO [User] (Login, PasswordHash, StudentID) VALUES ('{userName}', '{hashedPassword}', {studentId})";

            ExecuteNonQueryInternal(sql);
        }
コード例 #2
0
        public void ResetPassword(string userName, string newPassword)
        {
            var sql = $"UPDATE [User] SET [PasswordHash] = '{HashPasswordService.Hash(newPassword)}' WHERE [Login] = '{userName}'";

            ExecuteNonQueryInternal(sql);
        }