Inheritance and navigation properties to child entities
<p>I have a problem with Navigation Properties while I'm using Inheritance (TPH - the only available at the moment in EF Core).</p>

<p>My hierarchy models:</p>

<pre><code>public class Proposal
{
    [Key]
    public int ProposalId { get; set; }

    [Required, Column(TypeName = "text")]
    public string Substantiation { get; set; }

    [Required]
    public int CreatorId { get; set; }

    [ForeignKey("CreatorId")]
    public Employee Creator { get; set; }

}

public class ProposalLeave : Proposal
{
    [Required]
    public DateTime LeaveStart { get; set; }

    [Required]
    public DateTime LeaveEnd { get; set; }
}

public class ProposalCustom : Proposal
{
    [Required, StringLength(255)]
    public string Name { get; set; }

}
</code></pre>

<p>And a part of DbContext:</p>

<pre><code>public class AppDbContext : IdentityDbContext&lt;User, Role, int&gt;
{

    public DbSet&lt;Employee&gt; Employee { get; set; }
    public DbSet&lt;Proposal&gt; Proposal { get; set; }

    public AppDbContext(DbContextOptions&lt;AppDbContext&gt; options)
        : base(options)
    {
    }

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        base.OnModelCreating(modelBuilder);

        modelBuilder.Entity&lt;Proposal&gt;()
            .HasDiscriminator&lt;string&gt;("proposal_type")
            .HasValue&lt;Proposal&gt;("proposal_base")
            .HasValue&lt;ProposalCustom&gt;("proposal_custom")
            .HasValue&lt;ProposalLeave&gt;("proposal_leave");

    }
}
</code></pre>

<p>Ok, let's get to the point. As you can see inside parent Proposal model I have property CreatorId - reference to Employee entity. Inside Employee model I want to have two navigation properties to load created Proposals of child types as below:</p>

<pre><code>public class Employee
{
    public ICollection&lt;ProposalCustom&gt; CreatedProposalCustoms { get; set; } 
    public ICollection&lt;ProposalLeave&gt; CreatedProposalLeaves { get; set; } 

}
</code></pre>

<p>But it causes migration errors. After I applied migration I have two references to Employee entity (CreatorId, EmployeeUserId) inside Proposal table instead of one (CreatorId). When I changed navigation properties to:</p>

<pre><code>public class Employee
{      
    public ICollection&lt;Proposal&gt; CreatedProposals { get; set; } 
}
</code></pre>

<p>model was correct (there was only one reference to Employee inside Proposal table), but I still can't Include() to Employee model CreatedProposalCustoms and CreatedProposalLeaves separately.</p>

<p>The problem is probably inside my DbContext configuration, but I have no idea how to setup it correctly :/</p>