Take these two code things:
instance.GetType()
.GetCustomAttributes(true)
.Where(item => item is ValidationAttribute);
And
TypeDescriptor.GetAttributes(instance)
.OfType<ValidationAttribute>();
If the class looks like:
[RequiredIfOtherPropertyIsNotEmpty("State", "City", ErrorMessage = ErrorDescription.CreateAccount_CityRequiredWithState)]
[RequiredIfOtherPropertyIsNotEmpty("State", "Address1", ErrorMessage = ErrorDescription.CreateAccount_Address1RequiredWithState)]
public class ManagePostModel
{
...
}
Where RequiredIfOtherPropertyIsNotEmpty is a ValidationAttribute and has AllowMultiple = true.
The first one returns two attributes, the second returns one.
What's the difference that would cause this?