title: Auto-generated class from EF6 to implement custom interface
body: <p>I am using EF 6. I have a table in db for which the auto-generated class looks like this:</p>
  
  <pre><code>public partial class tblPreparation
  {
      [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
      public tblPreparation()
      {
          this.tblPreparationItem = new HashSet&lt;tblPreparationItem&gt;();
      }
  
      public int id { get; set; }
      public string name { get; set; }
      public System.DateTime date { get; set; }
  
      [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
      public virtual ICollection&lt;tblPreparationItem&gt; tblPreparationItem { get; set; }
  }
  </code></pre>
  
  <p>In my code, I want this class to extend another class EntityObject, which is in the namespace System.Data.Entity.Core.Objects.DataClasses (and implement another interface). So I created wrote this partial class:</p>
  
  <pre><code>public partial class tblPreparation : EntityObject, IMyInterface
  {
  
  }
  </code></pre>
  
  <p>It doesn't throw a syntax error but when I run the application I get runtime error: "The type 'tblPreparation' was not mapped. Check that the type has not been explicitly excluded by using the Ignore method or NotMappedAttribute data annotation. Verify that the type was defined as a class, is not primitive or generic, and does not inherit from EntityObject." What am I missing?</p>
  
  <p>I assum it's because they are not in the same namespace. Is there a way to fix this?</p>