title: Overriding default Required ErrorMessage property in .NET Core
body: <p>I have generated my DbContext using EF with DataAnnotations set and would like to override the Required ErrorMessage property using ModelMetadataType</p>
  
  <p>eg</p>
  
  <p>Generated class</p>
  
  <pre><code>public partial class ControlType
  {
      public ControlType()
      {
          Rule = new HashSet&lt;Rule&gt;();
      }
  
      [Key]
      public int ControlTypeId { get; set; }
      [Required]
      [StringLength(200)]
      public string Name { get; set; }
  
      [InverseProperty("ControlType")]
      public virtual ICollection&lt;Rule&gt; Rule { get; set; }
  }
  </code></pre>
  
  <p>My extension class</p>
  
  <pre><code>[ModelMetadataType(typeof(ControlTypeMeta))]
  public partial class ControlType
  {
  }
  
  public class ControlTypeMeta
  {
      [Display(Name = "Id")]
      public int ControlTypeId { get; set; }
  
      [Display(Name = "Control type")]
      [Required(ErrorMessage = "'{0}' is required")]
      public string Name { get; set; }
  }
  </code></pre>
  
  <p>With the above I am expecting the Required ErrorMessage to be output as "'Control type' is required", but instead I get the default "The Control type field is required"</p>
  
  <p><a href="https://i.stack.imgur.com/0cCIQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0cCIQ.png" alt="screenshot"></a></p>
  
  <p>Does anyone know how I can override the message (without creating view models)</p>