title: Is it OK to put a database initialization call in a C# constructor?
body: <p>I've seen this is various codebases, and wanted to know if this generally frowned upon or not.</p>
  
  <p>For example:</p>
  
  <pre><code>public class MyClass
  {
     public int Id;
  
     public MyClass()
     {
        Id = new Database().GetIdFor(typeof(MyClass));
     }
  }
  </code></pre>