title: Entity framework database first protected constructor
body: <p>How do I make my constructor protected in when using entity framework database first?</p>
  
  <p>When I generate an Entity Data Model from my database, the auto generated class contains a public constructor,  </p>
  
  <pre><code>//------------------------------------------------------------------------------
  // &lt;auto-generated&gt;
  //     This code was generated from a template.
  //
  //     Manual changes to this file may cause unexpected behavior in your application.
  //     Manual changes to this file will be overwritten if the code is regenerated.
  // &lt;/auto-generated&gt;
  //------------------------------------------------------------------------------
  
  namespace Domain.Models
  {
      using System;
      using System.Collections.Generic;
  
      public partial class MyClass
      {
          public MyClass()
          {
  </code></pre>
  
  <p>what I would like is a protected constructor</p>
  
  <pre><code>    public partial class MyClass
      {
          protected MyClass()
          {
  </code></pre>