I search with reflector and I didn't manage to find a case where the ValidationResult.MemberNames
is supposed to contain more than one value.
So, first of all I am wondering why MS had to do it IEnumerable<string>
, then now that they already did this, can I rely that this property will only return one value?
Update
Concerning the DataAnnotations validation system I find more sloppiness:
TryValidateProperty
and TryValidateObject
should have removed the errors from the validationResults parameter if they don't exist any more.And the list goes on.
Consider Password and PasswordConfirmation. Or any Start/Stop values, or any other cross-field validation.