title: How do I set a readonly field in an initialize method that gets called from the constructor?
body: <p>I'm sure I've seen somewhere that I can do the following by using an attribute above my Init() method, that tells the compiler that the Init() method must only be called from the constructor, thus allowing the readonly field to be set. I forgot what the attribute is called though, and I can't seem to find it on google.</p>
  
  <pre><code>public class Class
  {
      private readonly int readonlyField;
  
      public Class()
      {
          Init();
      }
  
      // Attribute here that tells the compiler that this method must be called only from a constructor
      private void Init()
      {
          readonlyField = 1;
      }
  }
  </code></pre>