title: Does Entity Framework support circular references?
body: <p>I have two entities in parent/child relationship. In addition, parent contains a reference to a "main" child, so the simplified model looks like this:</p>
  
  <pre><code>class Parent
  {
     int ParentId;
     int? MainChildId;
  }
  
  class Child
  {
     int ChildId;
     int ParentId;
  }
  </code></pre>
  
  <p>The problem I am experiencing now is that EF does not seem to be able to handle creation of both Parent and Child in a single operation. I am getting an error "System.Data.UpdateException: Unable to determine a valid ordering for dependent operations. Dependencies may exist due to foreign key constraints, model requirements, or store-generated values."</p>
  
  <p>MainChildId is nullable, so it should be possible to generate a parent, a child and then update a parent with the newly generated  ChildId. Is this something that EF does not support?</p>