title: Getting all related objects via related table. Entity Framework
body: <p>I have two tables. Parent table and link table that stores ids. Parent table have related data from itself. Here is Models:</p>
  <pre><code>public class People
  {
  public int Id { get; set; }
  public string FirstName { get; set; }
  public string LastName { get; set; }   
  public List&lt;Relation&gt; Relations { get; set; }
  }
  
  public class Relation
  {
  public int Id { get; set; }
  public int ParentPeopleID { get; set; }
  public int ChildPeopleID { get; set; }   
  public People People { get; set; }
  }
  </code></pre>
  <p>Some test data<a href="https://i.stack.imgur.com/UrMgj.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UrMgj.jpg" alt="enter image description here" /></a>
  And mapped them like this</p>
  <pre><code>HasRequired(p =&gt; p.People).WithMany(p =&gt; p.Relations).HasForeignKey(p =&gt; p.ParentPeopleID);
  </code></pre>
  <p>When I'm calling</p>
  <pre><code>var Peoplelist = MyDbContext.People.Include(p=&gt;p.Relations.Select(r=&gt;r.People)).Where(p=&gt;p.Id==1).ToList();
  </code></pre>
  <p>It returns itself not related People. In my case it should returns People with ids: 2,3,4 but returns three People with id 1</p>
  <p>I can get what I need by MyDbContext.Relation but need by MyDbContext.People</p>
  <p>What i'm doing wrong?
  Is there another way to do that?</p>