AssessmentAnywhere.Services.Users.User.ChangePassword C# (CSharp) Method

ChangePassword() public method

public ChangePassword ( string newPassword, string existingPassword ) : void
newPassword string
existingPassword string
return void
        public void ChangePassword(string newPassword, string existingPassword)
        {
            if (!this.ValidatePassword(existingPassword))
            {
                throw new IncorrectPasswordException();
            }

            if (string.IsNullOrWhiteSpace(newPassword))
            {
                throw new ArgumentNullException("newPassword", "Password must have a value.");
            }

            this.password = newPassword;
        }