/// <summary>
        /// <para>Initializes a new instance of the <see cref="EnumConversionValidator"/>.</para>
        /// </summary>
        /// <param name="enumType">The enum type to check if the string can be converted.</param>
        /// <param name="messageTemplate">The message template to use when logging results.</param>
        /// <param name="negated">True if the validator must negate the result of the validation.</param>
        public EnumConversionValidator(Type enumType, string messageTemplate, bool negated)
            : base(messageTemplate, null, negated)
        {
            ValidatorArgumentsValidatorHelper.ValidateEnumConversionValidator(enumType);

            this.enumType = enumType;
        }
Пример #2
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="EnumConversionValidatorAttribute"/> </para>
        /// </summary>
        public EnumConversionValidatorAttribute(Type enumType)
        {
            ValidatorArgumentsValidatorHelper.ValidateEnumConversionValidator(enumType);

            this.enumType = enumType;
        }