title: EF inheritance with table splitting
body: <p>I'm trying to map two different EF models to the same table SharedTable, let us call them EntityA and EntityB. I made them both extend a base Entity called BaseEntity.</p>
  
  <p>EntityA is defined only with SharedTable fields, EntityB has fields in SharedTable and EntityBTable.</p>
  
  <pre><code>        modelBuilder.Entity&lt;BaseEntity&gt;()
              .Map&lt;EntityA&gt;(m =&gt; m.Requires("IsEntityA").HasValue&lt;bool&gt;(true))
              .Map&lt;EntityB&gt;(m =&gt; m.Requires("IsEntityA").HasValue&lt;false&gt;(true));
  
          modelBuilder.Configurations.Add(new EntityBMap());
          modelBuilder.Configurations.Add(new EntityAMap());
          modelBuilder.Configurations.Add(new BaseEntityMap());
  </code></pre>
  
  <p>The models look like this</p>
  
  <pre><code>public class BaseEntity
  {
      [Required]
      public int Id { get; set; }
      public int SharedTableField1 { get; set; }
  }
  
  public class EntityA : BaseEntity
  {
      public int SharedTableField2 { get; set; }
  }
  
  public class EntityB : BaseEntity
  {
      public int EntityBTableField1 { get; set; }
  }
  </code></pre>
  
  <p>The mappings are</p>
  
  <pre><code>public class BaseEntityMap : EntityTypeConfiguration&lt;BaseEntity&gt;
  {
      public BaseEntityMap()
      {
          // Primary Key
          this.HasKey(t =&gt; t.Id);
  
          this.ToTable("SharedTable");
          this.Property(t =&gt; t.Id).HasColumnName("Id");
          this.Property(t =&gt; t.SharedTableField1).HasColumnName("SharedTableField1");
      }
  }
  
  public class EntityAMap : EntityTypeConfiguration&lt;EntityA&gt;
  {
      public EntityAMap()
      {
          this.HasKey(t =&gt; t.Id);
          this.Property(t =&gt; t.Id).HasColumnName("Id");
          this.ToTable("SharedTable");
          this.Property(t =&gt; t.SharedTableField2).HasColumnName("SharedTableField2");
      }
  }
  
  public class EntityBMap : EntityTypeConfiguration&lt;EntityB&gt;
  {
      public EntityBMap()
      {
          Map(c =&gt;
          {
              HasKey(t =&gt; t.Id);
              Property(t =&gt; t.Id).HasColumnName("Id");
              c.Properties(t =&gt; new
              {
                  t.SharedTableField2
              });
              c.ToTable("SharedTable");
          });
  
          Map(c =&gt;
          {
              c.Properties(t =&gt; new
              {
                  t.EntityBTableField1
              });
              c.ToTable("EntityBTable");
          });
      }
  }
  </code></pre>
  
  <p>The error I get says:</p>
  
  <p>A first chance exception of type 'System.NotSupportedException' occurred in EntityFramework.dll</p>
  
  <p>Additional information: The type 'EntityB' cannot be mapped as defined because it maps inherited properties from types that use entity splitting or another form of inheritance. Either choose a different inheritance mapping strategy so as to not map inherited properties, or change all types in the hierarchy to map inherited properties and to not use splitting.</p>
  
  <p>Any way around this?</p>