title: Automatic Model Validation When Generating the Models using Entity Framework Database First Approach
body: <p>Consider the following property UserName of a Model Class. You can see that the validation criteria are added over it manually.</p>
  
  <pre><code>[Required]
  [StringLength(100, MinimumLength = 6)]
  public string UserName { get; set; }
  </code></pre>
  
  <p>Now again consider the following code:</p>
  
  <pre><code>public string UserName { get; set; }
  </code></pre>
  
  <p>The same property without the validators. Now when I am generating the model class using Entity Framework Database first approach I am getting the later result (means a property without having validators). But in the database there are constraints added over each attribute.</p>
  
  <p>So is there any tool/way that I can use those constraints and generate the model class having properties like shown in code 1 (that is property with validators). </p>