Exemplo n.º 1
0
        private static void ValidateAttributeValidation(ValidateAttribute attribute, object value, PropertyInfo property, Errors errors)
        {
            if (attribute.Required)
            {
                RequiredAttribute.Validate(property, value, errors);
            }

            if (attribute.MinLength > 0)
            {
                MinLengthAttribute.Validate(property, value, errors);
            }

            if (attribute.MaxLength > 0)
            {
                MaxLengthAttribute.Validate(property, value, errors);
            }
        }