;         }          /// <summary>         /// 要求必须输入         /// </summary>         /// <typeparam name="T"></typeparam>         /// <typeparam name="TKey"></typeparam>         /// <param name="fluent"></param>         /// <param name="keySelector">属性选择</param>         /// <returns></returns>         public static FluentApi<T> Required<T, TKey>(this FluentApi<T> fluent, Expression<Func<T, TKey>> keySelector)         {             return fluent.SetRule(keySelector, new RequiredAttribute());         }          /// <summary>         /// 要求必须输入         /// </summary>         /// <typeparam name="T"></typeparam>         /// <typeparam name="TKey"></typeparam>         /// <param name="fluent"></param>         /// <param name="keySelector">属性选择</param>         /// <param name="errorMessage">错误提示消息</param>         /// <returns></returns>         public static FluentApi<T> Required<T, TKey>(this FluentApi<T> fluent, Expression<Func<T, TKey>> keySelector, string errorMessage)         {             return fluent.SetRule(keySelector, new RequiredAttribute { ErrorMessage = errorMessage });         }           /// <summary>         /// 验证是邮箱格式         /// </summary>         /// <typeparam name="T"></typeparam>         /// <param name="fluent"></param>         /// <param name="keySelector">属性选择</param>         /// <returns></returns>         public static FluentApi<T> Email<T>(this FluentApi<T> fluent, Expression<Func<T, string>> keySelector)         {             return fluent.SetRule(keySelector, new EmailAttribute());         }          /// <summary>         /// 验证是邮箱格式         /// </summary>         /// <typeparam name="T"></typeparam>         /// <param name="fluent"></param>         /// <param name="keySelector">属性选择</param>         /// <param name="errorMessage">错误提示消息</param>         /// <returns></returns>         public static FluentApi<T> Email<T>(this FluentApi<T> fluent, Expression<Func<T, string>> keySelector, string errorMessage)         {             return fluent.SetRule(keySelector, new EmailAttribute { ErrorMessage = errorMessage });         }          /// <summary>         /// 验证是否和目标属性的值一致         /// </summary>         /// <typeparam name="T"></typeparam>         /// <typeparam name="TKey"></typeparam>         /// <typeparam name="TTargetKey"></typeparam>         /// <param name="fluent"></param>         /// <param name="keySelector">属性选择</param>         /// <param name="targetKeySelector">目标属性选择</param>         /// <returns></returns>         public static FluentApi<T> EqualTo<T, TKey, TTargetKey>(this FluentApi<T> fluent, Expression<Func<T, TKey>> keySelector, Expression<Func<T, TTargetKey>> targetKeySelector)         {             var propertyName = FluentApiExtend.GetProperty(targetKeySelector).Name;             return fluent.SetRule(keySelector, new EqualToAttribute(propertyName));         }          /// <summary>         /// 验证是否和目标属性的值一致         /// </summary>         /// <typeparam name="T"></typeparam>         /// <typeparam name="TKey"></typeparam>         /// <typeparam name="TTargetKey"></typeparam>         /// <param name="fluent"></param>         /// <param name="keySelector">属性选择</param>         /// <param name="targetKeySelector">目标属性选择</param>         /// <param name="errorMessage">错误提示信息</param>         /// <returns></returns>         public static FluentApi<T> EqualTo<T, TKey, TTargetKey>(this FluentApi<T> fluent, Expression<Func<T, TKey>> keySelector, Expression<Func<T, TTargetKey>> targetKeySelector, string errorMessage)         {             var propertyName = FluentApiExtend.GetProperty(targetKeySelector).Name;             return fluent.SetRule(keySelector, new EqualToAttribute(propertyName) { ErrorMessage = errorMessage });         }            /// <summary>         /// 验证输入的长度范围         /// </summary>         /// <typeparam name="T"></typeparam>         /// <param name="fluent"></param>         /// <param name="keySelector">属性选择</param>         /// <param name="maxLength">最大长度</param>         /// <returns></returns>         public static FluentApi<T> Length<T>(this FluentApi<T> fluent, Expression<Func<T, string>> keySelector, int maxLength)         {             return fluent.SetRule(keySelector, new LengthAttribute(maxLength));         }          /// <summary>         /// 验证输入的长度范围         /// </summary>         /// <typeparam name="T"></typeparam>         /// <param name="fluent"></param>         /// <param name="keySelector">属性选择</param>         /// <param name="maxLength">最大长度</param>         /// <param name="errorMessage">错误提示信息</param>         /// <returns></returns>         public static FluentApi<T> Length<T>(this FluentApi<T> fluent, Expression<Func<T, string>> keySelector, int maxLength, string errorMessage)         {             return fluent.SetRule(keySelector, new LengthAttribute(maxLength) { ErrorMessage = errorMessage });         }          /// <summary>         /// 验证输入的长度范围         /// </summary>         /// <typeparam name="T"></typeparam>         /// <param name="fluent"></param>         /// <param name="keySelector">属性选择</param>         /// <param name="maxLength">最大长度</param>         /// <param name="minValue">最小长度</param>         /// <returns></returns>         public static FluentApi<T> Length<T>(this FluentApi<T> fluent, Expression<Func<T, string>> keySelector, int maxLength, int minValue)         {             return fluent.SetRule(keySelector, new LengthAttribute(maxLength) { MinimumLength = minValue });         }          /// <summary>         /// 验证输入的长度范围         /// </summary>         /// <typeparam name="T"></typeparam>         /// <param name="fluent"></param>         /// <param name="keySelector">属性选择</param>         /// <param name="maxLength">最大长度</param>         /// <param name="minValue">最小长度</param>         /// <param name="errorMessage">错误提示消息</param>         /// <returns></returns>         public static FluentApi<T> Length<T>(this FluentApi<T> fluent, Expression<Func<T, string>> keySelector, int maxLength, int minValue, string errorMessage)         {             return fluent.SetRule(keySelector, new LengthAttribute(maxLength) { MinimumLength = minValue