public ValidationResult IsValid(PropertyInfo propertyToValidate, object value)
{
if (value == null) return ValidationResult.Success;
return !value.ToString().HasMaxLength(length) ? ValidationResult.CreateError(propertyToValidate, "Adf.Business.AttributeMaxLengthInvalid", propertyToValidate.Name, length) : ValidationResult.Success;
}