title: EF Core 2.2, owned entities generated as another table when multiple in hierarchy
body: <p>I have a model with a class <code>Address</code> marked <code>[Owned]</code> and a hierarchy of people (person, customer or employee, then even more subtypes etc). There are addresses at different stages of this hierarchy and all of it ends up in one table as EF Core is limited to table per hierarchy. I expected all the attributes from address to appear multiple times in that person table (once per mention in any of the subtypes) however it doesn't appear at all! Instead i see FK for each of them and a separate Address table.</p>
  
  <p>Does EF Core not support multiple owned members of the same type? If not is there anything i should do? I don't have any fluent API / specific configuration that could interfere with the defaults (new empty console project, only config line is .UseSQLServer(connectionstring)</p>
  
  <p>Sample code bellow : </p>
  
  <pre><code>public class SampleContext : DbContext
  {
      public virtual DbSet&lt;Address&gt; Addresses { get; set; }
      public virtual DbSet&lt;Customer&gt; Customers { get; set; }
      public virtual DbSet&lt;Employee&gt; Employees { get; set; }
      public virtual DbSet&lt;Person&gt; Persons { get; set; }
  
      protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
      {
          if (!optionsBuilder.IsConfigured)
          {
              optionsBuilder.UseSqlServer("my connection string here");
          }
          base.OnConfiguring(optionsBuilder);
      }
  }
  [Owned]
  public class Address
  {
      public int Id { get; set; }
      public string AddressLine1 { get; set; }
      public string AddressLine2 { get; set; }
      public string AddressLine3 { get; set; }
      public string City { get; set; }
  }
  
  public class Person
  {
      public int Id { get; set; }
      public string FirstName { get; set; }
      public string LastName { get; set; }
      public DateTime DateOfBirth { get; set; }
  }
  
  public class Employee : Person
  {
      public Address Address { get; set; }
  }
  
  public class Customer : Person
  {
      public Address DeliveryAddress { get; set; }
      public Address InvoicingAddress { get; set; }
  }
  </code></pre>
  
  <p>Expected <code>Person</code> table : </p>
  
  <pre><code>DeliveryAddressAddressLine1
  DeliveryAddressAddressLine2
  DeliveryAddressAddressLine3
  DeliveryAddressAddressCity
  InvoicingAddressAddressLine1
  InvoicingAddressAddressLine2
  InvoicingAddressAddressLine3
  InvoicingAddressAddressCity
  EmployeeAddressAddressLine1
  EmployeeAddressAddressLine2
  EmployeeAddressAddressLine3
  EmployeeAddressAddressCity
  </code></pre>
  
  <p>Generated <code>Person</code> table (+ an unexpected <code>Address</code> table): </p>
  
  <pre><code>EmployeeAddressAddressId
  DeliveryAddressAddressId
  InvoicingAddressAddressId
  </code></pre>
  
  <p>Edit : updated the question, added the context definition and noticed i had <code>Addresses</code> as a DbSet so i assume this may be the cause, removing it gives me the following error : </p>
  
  <blockquote>
    <p>Cannot use table 'Person' for entity type 'Customer.DeliveryAddress#Address' since it is being used for entity type 'Employee.Address#Address' and there is no relationship between their primary keys.`</p>
  </blockquote>