title: Cannot use table 'Accounts' for entity type 'User' since it is being used for entity type 'Address'
body: <p>I am losing my mind right now. I am trying to model my database model with navigation properties that exist on both child and parent identities. Meaning, the parent has a nav property pointing to the child and the child has a nav property pointing to the parent.</p>
  
  <p>Here is my Model:</p>
  
  <pre><code>public class User : IdentityUser
  {
      public Company Company { get; set; }
      public Employee Employee { get; set; }
  }
  
  public class Employee
  {
      [Key]
      public int ID { get; set; }
      public Address Address { get; set; }
      public User Account { get; set; }
  }
  
  public class Company
  {
      [Key]
      public int ID { get; set; }
      public List&lt;User&gt; Accounts { get; set; }
  }
  
  public class Address
  {
      [Key]
      public int ID { get; set; }
      public Employee Employee { get; set; }
  }
  </code></pre>
  
  <p>I then created a database context class like so:</p>
  
  <pre><code>public class UserManagementDbContext : IdentityDbContext&lt;User&gt;
  {
      public DbSet&lt;Company&gt; Companies { get; set; }
      public DbSet&lt;Employee&gt; Employees { get; set; }
      public DbSet&lt;Address&gt; Addresses { get; set; }
  
      public UserManagementDbContext(DbContextOptions&lt;UserManagementDbContext&gt; options)
             : base(options)
      {
      }
  
      protected override void OnModelCreating(ModelBuilder builder)
      {
          base.OnModelCreating(builder);
  
          builder.Entity&lt;User&gt;()
              .OwnsOne(cu =&gt; cu.Employee)
              .HasOne(e =&gt; e.Account);
          builder.Entity&lt;User&gt;()
              .HasOne(cu =&gt; cu.Company)
              .WithMany(c =&gt; c.Accounts);
          builder.Entity&lt;Employee&gt;()
              .OwnsOne(e =&gt; e.Address)
              .HasOne(a =&gt; a.Employee);
  
          builder.Entity&lt;User&gt;().ToTable("Accounts");
          builder.Entity&lt;IdentityRole&gt;().ToTable("Roles");
      }
  }
  </code></pre>
  
  <p>I then call EnsureCreated() method of database in my Startup.cs like so:</p>
  
  <pre><code>private async Task InitializeDatabase(IServiceProvider serviceProvider)
  {
      using (var serviceScope = serviceProvider.GetRequiredService&lt;IServiceScopeFactory&gt;().CreateScope())
      {
          using (var db = serviceProvider.GetService&lt;UserManagementDbContext&gt;())
          {
              db.Database.EnsureCreated();
              //...omitted
          }
      }
  }
  </code></pre>
  
  <p>This is where the app fails with the above error and I do not understand why. There is no relationship between the Accounts and Addresses tables. Either I am blind as a bat and didn't notice a typo or this error is really confusing.</p>
  
  <p>Can anyone help me out here?</p>
  
  <p>EDIT: Please note that I do not want to use foreign keys, only navigation properties.</p>