title: How do I define additional initialization logic for the positional record?
body: <p>I would like to validate parameters used for record initialization and thro, if validation fails. For regular class I could use constructor for that, but how should I do it with records?</p>
  <p>For regular classes I could also have private constructor and public static factory method which returned either error or valid instance, but it looks like there is no way to make record's primary constructor private.</p>
  <p>For non-positional record it is like with any other class:</p>
  <pre><code>public record Person
  {
      public string FirstName {get; init;}
      public string LastName {get; init;}
      
      public Person (string firstName, string lastName)
      {
          (FirstName,LastName) = (firstName, lastName);
      }
  }
  </code></pre>