title: asp.net data annotations field length
body: <p>I currently have the following data annotation on a field</p>
  
  <pre><code>[StringLength(1000, MinimumLength = 6, ErrorMessage = "field must be atleast 6 characters")]
  public string myField {get;set;}
  </code></pre>
  
  <p>Can I change the data annotation such that it works only if the user types something in the field? In other words, it is okay to leave the field empty but if the user types a value in the field, it should be between 6-1000 characters in length.</p>