title: ASP.NET Data Annotation: How to validate a List of string?
body: <p>Data annotation to validate an inbound model in MVC:</p>
  
  <pre><code>public class ValidNumber
  {
      [RegularExpression(@"^\d+$", ErrorMessage = "*")]
      public string number { get; set; }
  }
  </code></pre>
  
  <p>Would I need to create my own class to validate a <code>List&lt;string&gt;</code> or can I do something like this?  What code could I write in C# to add a Regex validator for a list of string?</p>
  
  <pre><code>public class ValidNumberList
  {
      [RegularExpression(@"^\d+$", ErrorMessage = "*")]
      public List&lt;string&gt; numbers { get; set; }
  }
  </code></pre>