title: Data Annotations on record fails in unittest
body: <p>Currently we are setting up a new project and like to use the new records introduced in C# 9.
  We encounter a problem with DataAnnotations inside the record (constructor) not being triggered during the unittest.</p>
  <p>Now the DataAnnotation is triggered when calling the Controller, but when i try to simulate this in a unittest (see code below) it will never return any errors.</p>
  <pre><code>        //Unit Testing ASP.NET DataAnnotations validation
          //http://stackoverflow.com/questions/2167811/unit-testing-asp-net-dataannotations-validation
          protected static IList&lt;ValidationResult&gt; ValidateModel(object model)
          {
              var validationResults = new List&lt;ValidationResult&gt;();
              var ctx = new ValidationContext(model, null, null);
              Validator.TryValidateObject(model, ctx, validationResults, true);
              return validationResults;
          }
  </code></pre>
  <p>Currently we created a workaround:</p>
  <pre><code>    public record FooRecord(string BarProperty)
      {
          [Required]
          public string BarProperty { get; init; } = BarProperty;
  
      }
  </code></pre>
  <p>But I'm hoping if someone knows why this happens and maybe know how to solve this using the shorthand syntax:</p>
  <pre><code>    public record FooRecord([Required] BarProperty){ }
  </code></pre>