title: Use common table name across inheritance in ef core
body: <p>I am new to entity framework and started playing around with it. I am trying to use my usual structure that consists of a <code>Core</code> project that has raw properties. <code>DataAccess</code> extends core classes and adds any additional db specific property and the <code>DBContext</code> in this case. <code>Business</code> extends <code>DataAccess</code> and has all business logic. Finally, a <code>Models</code> project where multiple models may extend each business class for different purposes. </p>
  
  <p>My class in <code>Core</code> is something like this:</p>
  
  <pre><code>public class Blog
  {
      public int BlogId { get; set; }
      public string Url { get; set; }
  }
  </code></pre>
  
  <p>My <code>DataAcceess</code> got a context class like this:</p>
  
  <pre><code>public class MyContext : DbContext
  {
      public DbSet&lt;Blog&gt; Blogs { get; set; }
  }
  </code></pre>
  
  <p>And my <code>Business</code> got this:</p>
  
  <pre><code>public class Blog : DataAccess.Blog
  {
      public void Add()
      {
          using (var db = new MyContext())
          {
              db.Blogs.Add(this);
              db.SaveChanges();
          }
      }
  }
  </code></pre>
  
  <p>Finally my <code>Models</code> contains: </p>
  
  <pre><code>public class BlogModel : Business.Blog {}
  </code></pre>
  
  <p>Now I get an error that the entity type <code>BlogModel</code> doesn't exist. The table's name is Blog not BlogModel. I have tried the following: </p>
  
  <ol>
  <li>Adding <code>[Table("Blog")]</code> in DataAccess, Business and Model</li>
  <li>casting this as <code>(Blog)this</code>. The type still stays the same</li>
  <li>Creating a property <code>Blog Current =&gt; this</code> trying to change it's type.</li>
  </ol>
  
  <p><strong>Update:</strong> happens even when the model is named <code>Blog</code> </p>