title: EFCore - How to have multiple navigation properties to the same type?
body: <p>My model contains the classes Post and PostHistory, where Post has a one-to-many relationship with PostHistory.</p>
  
  <pre><code>class Post
  {
      public int Id { get; set; }
  
      public PostVersion CurrentVersion { get; set; }
      public PostVersion OriginalVersion { get; set; }
      public IList&lt;PostVersion&gt; History { get; set; }
  }
  
  class PostVersion
  {
      public int Id { get; set; }
      public Post Post { get; set; }
  
      public string Title { get; set; }
      public string Body { get; set; }
  }
  </code></pre>
  
  <p>The History property contains a list of all PostVersions related to that Post. The CurrentVersion and PreviousVersion properties both reference a perticlar version in that post history (most likley the most recent version and the first version).</p>
  
  <p>My problem is that EF Core struggles to understand the relationship due to the CurrentVersion and OriginalVersion navigation properties. When I try to create a migration, I get this error message:</p>
  
  <pre><code>Unable to determine the relationship represented by navigation property 'Post.CurrentVersion' of type 'PostVersion'. Either manually configure the relationship, or ignore this property using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.
  </code></pre>
  
  <p>After that I tried to use the Fluent API to create the relationships manually.</p>
  
  <pre><code>protected override void OnModelCreating(ModelBuilder builder)
  {
      base.OnModelCreating(builder);
  
      builder.Entity&lt;Post&gt;()
          .HasMany(x =&gt; x.History)
          .WithOne(x =&gt; x.Post);
      builder.Entity&lt;Post&gt;()
          .HasOne(x =&gt; x.CurrentVersion)
          .WithOne(x =&gt; x.Post);
      builder.Entity&lt;Post&gt;()
          .HasOne(x =&gt; x.OriginalVersion)
          .WithOne(x =&gt; x.Post);
  }
  </code></pre>
  
  <p>But created a different error:</p>
  
  <pre><code>Cannot create a relationship between 'PostVersion.Post' and 'Post.CurrentVersion', because there already is a relationship between 'Post.History' and 'PostVersion.Post'. Navigation properties can only participate in a single relationship.
  </code></pre>
  
  <p>Is it possible to create this kind of relationship in EF Core code-first?</p>