public ValidationItem(ValidationField <T> field, DataValidator validator, string fieldName)
 {
     _valueMethod  = field.FieldExpression.Compile();
     _validator    = validator;
     _fieldName    = fieldName;
     _errorMessage = field.ErrorMessage;
     if (field.CompareValue is Expression <Func <T, dynamic> > )
     {
         var compareExpress = (Expression <Func <T, dynamic> >)field.CompareValue;
         _comparePropertyName = ExpressionHelper.GetExpressionText(compareExpress);
         _compareValue        = compareExpress.Compile();
     }
     else
     {
         _compareValue = field.CompareValue;
     }
 }
 /// <summary>
 /// 不再某些值内
 /// </summary>
 /// <typeparam name="T">数据类型</typeparam>
 /// <param name="value">比较的值</param>
 /// <param name="field">验证字段</param>
 public static void NotIn <T>(IEnumerable <dynamic> value, ValidationField <T> field)
 {
     SetCompareValidation(CompareOperator.NotIn, value, field);
 }
 /// <summary>
 /// 相等性比较
 /// </summary>
 /// <typeparam name="T">数据类型</typeparam>
 /// <param name="value">比较的值</param>
 /// <param name="field">验证字段</param>
 public static void GreaterThanOrEqual <T>(Expression <Func <T, dynamic> > value, ValidationField <T> field)
 {
     SetCompareValidation(CompareOperator.GreaterThanOrEqual, value, field);
 }
 /// <summary>
 /// 相等性比较
 /// </summary>
 /// <typeparam name="T">数据类型</typeparam>
 /// <param name="value">比较的值</param>
 /// <param name="field">验证字段</param>
 public static void GreaterThanOrEqual <T>(dynamic value, ValidationField <T> field)
 {
     SetCompareValidation(CompareOperator.GreaterThanOrEqual, value, field);
 }
 /// <summary>
 /// 相等性比较
 /// </summary>
 /// <typeparam name="T">数据类型</typeparam>
 /// <param name="value">比较的值</param>
 /// <param name="field">验证字段</param>
 public static void LessThan <T>(Expression <Func <T, dynamic> > value, ValidationField <T> field)
 {
     SetCompareValidation(CompareOperator.LessThan, value, field);
 }
 /// <summary>
 /// 相等性比较
 /// </summary>
 /// <typeparam name="T">数据类型</typeparam>
 /// <param name="value">比较的值</param>
 /// <param name="field">验证字段</param>
 public static void LessThan <T>(dynamic value, ValidationField <T> field)
 {
     SetCompareValidation(CompareOperator.LessThan, value, field);
 }
 /// <summary>
 /// 相等性比较
 /// </summary>
 /// <typeparam name="T">数据类型</typeparam>
 /// <param name="value">比较的值</param>
 /// <param name="field">验证字段</param>
 public static void NotEqual <T>(dynamic value, ValidationField <T> field)
 {
     SetCompareValidation(CompareOperator.NotEqual, value, field);
 }
        /// <summary>
        /// 设置比较验证
        /// </summary>
        /// <typeparam name="T">数据类型</typeparam>
        /// <param name="compareOperator">操作符</param>
        /// <param name="value">比较值</param>
        /// <param name="field">验证字段</param>
        public static void SetCompareValidation <T>(CompareOperator compareOperator, dynamic value, ValidationField <T> field)
        {
            string        validatorKey = string.Format("{0}/{1}", typeof(CompareValidator).FullName, (int)compareOperator);
            DataValidator validator    = null;

            if (_validatorList.ContainsKey(validatorKey))
            {
                validator = _validatorList[validatorKey];
            }
            else
            {
                validator = new CompareValidator(compareOperator);
                _validatorList.Add(validatorKey, validator);
            }
            field.CompareValue = value;
            SetValidation(validator, field);
        }