title: MaxLength annotation to maxlength input property
body: <p>Using the following DataAnnotations in ASP.NET Core 1.1. It would be good to have the max length of the input in my MVC View to be set to restrict the users input.</p>
  
  <p><strong>Model</strong>    </p>
  
  <pre><code>[Display(Name = "Post Code")]
  [MaxLength(8, ErrorMessage = "Maximum number of characters that can be entered is 8!")]
  public string PostCode
  { get; set; }
  </code></pre>
  
  <p><strong>View</strong></p>
  
  <pre><code>&lt;label asp-for="PostCode"&gt;&lt;/label&gt;
  &lt;input style="font-weight: normal;" class="form-control" placeholder="Post Code" asp-for="PostCode" data-val="true" autofocus /&gt;
  </code></pre>
  
  <p><strong>renders as</strong></p>
  
  <pre><code>&lt;input style="font-weight: normal;" class="form-control valid" placeholder="Post Code" data-val="true" autofocus="" type="text" data-val-maxlength="Maximum number of characters that can be entered is 8!" data-val-maxlength-max="8" id="PostCode" name="PostCode" value="" wtx-context="FA5749C8-68AC-44FE-88B9-4BBDF9D48DAE" aria-invalid="false" aria-describedby="PostCode-error"&gt;
  </code></pre>
  
  <p>I am wanting to <strong>generate</strong> the maxlength attribute from my class data annotation as per the below. (scroll to end);</p>
  
  <pre><code>&lt;input style="font-weight: normal;" class="form-control valid" placeholder="Post Code" data-val="true" autofocus="" type="text" data-val-maxlength="Maximum number of characters that can be entered is 8!" data-val-maxlength-max="8" id="PostCode" name="PostCode" value="" wtx-context="FA5749C8-68AC-44FE-88B9-4BBDF9D48DAE" aria-invalid="false" aria-describedby="PostCode-error" maxlength="8"&gt;
  </code></pre>
  
  <p>Appreciate any advice.</p>