title: Overriding code-generated DbContext constructor
body: <p>I'm sure I've done this before at some stage, but I can't figure out how to now! My scenario:</p>
  
  <pre><code>// This is generated from EDMX
  public partial class HOLDbEntities : DbContext
  {
      public HOLDbEntities()
              : base("name=HOLDbEntities")
          {
          }
  }
  </code></pre>
  
  <p>Now, I want this connection string to be easily changeable (I want to Implement from the HOLDbEntities), so I need to override this constructor.</p>
  
  <p>I've tried:</p>
  
  <pre><code>public partial class HOLDbEntities
  {
      private const string _contextName = "HOLDbEntities";
      public static string ContextName { get { return _contextName; } }
  
      public HOLDbEntities()
          : base(ContextName)
      {
      }
  }
  </code></pre>
  
  <p>But this throw an error:</p>
  
  <blockquote>
    <p>HOLDbEntities already defines a member called "HOLDbEntities" with the same parameter types.</p>
  </blockquote>
  
  <p>I can understand why this errors, but how would I stop the constructor being auto-generated in the first place in order to do what I'm trying to achieve?</p>