title: Entity Framework Itself referention -> parent/child
body: <p>Is it possible to set parent/child relations using EF Core and fluent api?</p>
  
  <p>I have following class</p>
  
  <pre><code>public class Category 
  {
     public int Id { get; set; }
     public int ParentId { get; set; }
     public string Name { get; set; }
     public ICollection&lt;Category&gt; SubCategories { get; set; }
  }
  </code></pre>
  
  <p>So if I create list of objects with have structure as below, it is possible that, EF set entitie's id, and parentId with appropriate numbers?</p>
  
  <ul>
  <li>Cat 1 
  
  <ul>
  <li>Cat 2
  
  <ul>
  <li>Cat 3</li>
  </ul></li>
  <li>Cat4 </li>
  <li>Cat5 </li>
  </ul></li>
  </ul>