title: ASP.Net MVC : ValidationResult does not accept int.tostring() for member name
body: <p>code taken from <a href="http://www.dotnetcurry.com/aspnet-mvc/1083/aspnet-mvc-self-validation-model-objects" rel="nofollow">http://www.dotnetcurry.com/aspnet-mvc/1083/aspnet-mvc-self-validation-model-objects</a></p>
  
  <pre><code>public class Person : IValidatableObject
      {
          public int Id { get; set; }
          [Required]
          public string Name { get; set; }
          [Required]
          public string Address { get; set; }
          [Required]
          public DateTime BirthDate { get; set; }
          [Required]
          public int Income { get; set; }
  
          public IEnumerable&lt;ValidationResult&gt; Validate(ValidationContext validationContext)
          {
              var pIncome = new[] { "Income" };
              if (Income &lt; 0)
              {
                  yield return new ValidationResult("Income cannot be negative", pIncome);
              }
              var pName = new[] { "Name" };
              if (Name.Length &gt; 40)
              {
                  yield return new ValidationResult("Name cannot be such huge in length", pName);
              }
              var pBDate = new[] { "BirthDate" };
              if (BirthDate &gt; DateTime.Now)
              {
                  yield return new ValidationResult("Sorry Future Date cannot be accepted.", pBDate);
              }
  
          }
      }
  </code></pre>
  
  <h2>see this line</h2>
  
  <pre><code>yield return new ValidationResult("Income cannot be negative", pIncome);
  </code></pre>
  
  <p>if i write it like</p>
  
  <pre><code>yield return new ValidationResult("Income cannot be negative", Income.ToString());
  </code></pre>
  
  <p>then getting error but the moment we pass a string variable then no problem. so if i need to validate many int type property then do i need to put those property name in</p>
  
  <pre><code>string array like  var pIncome = new[] { "Income" }; ?
  </code></pre>
  
  <p>if some many element name is there in array then how to refer it for 2nd argument for <code>ValidationResult ctor</code> ?</p>
  
  <p>please help. thanks</p>