Пример #1
0
        public PasswordLengthAttribute(string passwordRequiredPropertyName, string encryptedPasswordPropertyName, string saltPropertyName, int minLength = 0, int maxLength = 255) : base("Error PasswordLengthAttribute")
        {
            _passwordRequiredPropertyName  = passwordRequiredPropertyName;
            _encryptedPasswordPropertyName = encryptedPasswordPropertyName;
            _saltPropertyName = saltPropertyName;

            //If for some reason someone entered a minimum length smaller than the max length, swap the 2 values
            if (minLength > maxLength)
            {
                IntExtensions.SwapTwoIntegers(minLength, maxLength, out minLength, out maxLength);
            }

            _minimumLength = minLength;
            _maximumLength = maxLength;
        }