public async Task <IdentityResult> UserChangePasswordAsync(UserChangePasswordDto userPassword)
        {
            var userExists = await _identityRepository.ExistsUserAsync(userPassword.UserId);

            if (!userExists)
            {
                throw new UserFriendlyErrorPageException(string.Format(_identityServiceResources.UserDoesNotExist().Description, userPassword.UserId), _identityServiceResources.UserDoesNotExist().Description);
            }

            var identityResult = await _identityRepository.UserChangePasswordAsync(userPassword.UserId, userPassword.Password);

            return(HandleIdentityError(identityResult, _identityServiceResources.UserChangePasswordFailed().Description, _identityServiceResources.IdentityErrorKey().Description, userPassword));
        }
        public virtual async Task <IdentityResult> UserChangePasswordAsync(TUserChangePasswordDto userPassword)
        {
            var userExists = await IdentityRepository.ExistsUserAsync(userPassword.UserId.ToString());

            if (!userExists)
            {
                throw new UserFriendlyErrorPageException(string.Format(IdentityServiceResources.UserDoesNotExist().Description, userPassword.UserId), IdentityServiceResources.UserDoesNotExist().Description);
            }

            var identityResult = await IdentityRepository.UserChangePasswordAsync(userPassword.UserId.ToString(), userPassword.Password);

            await AuditEventLogger.LogEventAsync(new UserPasswordChangedEvent(userPassword.UserName));

            return(HandleIdentityError(identityResult, IdentityServiceResources.UserChangePasswordFailed().Description, IdentityServiceResources.IdentityErrorKey().Description, userPassword));
        }