Note that there are some explanatory texts on larger screens.

plurals
  1. POWill the ValidationResult.MemberNames property ever contain more than one value?
    primarykey
    data
    text
    <p>I search with reflector and I didn't manage to find a case where the <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.validationresult.membernames.aspx" rel="nofollow noreferrer"><code>ValidationResult.MemberNames</code></a> is supposed to contain more than one value.</p> <p>So, first of all I am wondering why MS had to do it <code>IEnumerable&lt;string&gt;</code>, then now that they already did this, can I rely that this property will only return one value?</p> <p><strong>Update</strong><br> Concerning the DataAnnotations validation system I find more sloppiness:</p> <ol> <li>The <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.validator.tryvalidateproperty.aspx" rel="nofollow noreferrer"><code>TryValidateProperty</code></a> and <a href="http://msdn.microsoft.com/en-us/library/dd411803.aspx" rel="nofollow noreferrer"><code>TryValidateObject</code></a> should have removed the errors from the <em>validationResults</em> parameter if they don't exist any more.</li> <li>ValidationResult should have overriden Equals and GetHashCode.</li> <li>Why is the ValidationResult.ErrorMessage mutable!? I can't event build an EqualityComparer myself!</li> <li>If the DataTypeAttribute is only used for representation concerns, why does it inherit ValidationAttribute, that's just misleading, I had to struggle till I understood (after reflectoring) that its not going to work. MS just didn't implement it.</li> </ol> <p>And the list goes on.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload