title: Why do I get: Unable to determine principle end of ... error with the following code
body: <p>currently tweaking the model on a project I'm working on and I've hit a wall and can't seem to spot why I'm getting an error.</p>
  
  <p>I have two class's</p>
  
  <pre><code>public class CorePage : BaseClass
  {
      public CorePage()
      {
          this.PageContent = new HashSet&lt;PageContent&gt;();
          this.PageAliases = new HashSet&lt;PageAlias&gt;();
          this.isEditable = true;
      }
  
      public string DisplayLabel { get; set; }
      public bool isEditable { get; set; }
  
      public int? ParentPageId { get; set; }
      public virtual CorePage ParentPage { get; set; }
  
      public int TemplateId { get; set; }
      public virtual Template Template { get; set; }        
  
      public int DefaultPageAliasId { get; set; }
      public virtual PageAlias DefaultPageAlias { get; set; }
  
      public virtual ICollection&lt;PageAlias&gt; PageAliases { get; set; }
      public virtual ICollection&lt;PageContent&gt; PageContent { get; set; }
  }
  </code></pre>
  
  <p>And</p>
  
  <pre><code>public class PageAlias : BaseClass
  {
      public PageAlias()
      {  
      }
      public string Alias { get; set; }
      public int PageId { get; set; }
      public virtual CorePage Page { get; set; }
  }
  </code></pre>
  
  <p>Relationships between the two class's are configured as follows.</p>
  
  <pre><code>public class CorePageConfiguration : EntityTypeConfiguration&lt;CorePage&gt;
  {
      public CorePageConfiguration()
      {
          HasOptional(cp =&gt; cp.ParentPage).WithMany().HasForeignKey(cp =&gt; cp.ParentPageId).WillCascadeOnDelete(false);
          HasRequired(p =&gt; p.DefaultPageAlias).WithRequiredDependent().WillCascadeOnDelete(false);
      }
  }
  </code></pre>
  
  <p>And</p>
  
  <pre><code>public class PageAliasConfiguration : EntityTypeConfiguration&lt;PageAlias&gt;
  {
      public PageAliasConfiguration()
      {
          Property(pa =&gt; pa.Alias).IsRequired().HasMaxLength(500);
          HasRequired(pa =&gt; pa.Page).WithMany(p =&gt; p.PageAliases).HasForeignKey(pa =&gt; pa.PageId).WillCascadeOnDelete(false);
      }
  }
  </code></pre>
  
  <p>Problem is I keep getting this error:</p>
  
  <pre><code>Unable to determine the principal end of the 'Core.DataContext.PageAlias_Page' relationship. Multiple added entities may have the same primary key.
  </code></pre>
  
  <p>And I cant seem to spot what I've missed.</p>
  
  <p>Any help would be much appreciated.</p>
  
  <p>Thanks,</p>