title: EF Code First Parent-Child insertions with identity columns
body: <p>i have the following model.</p>
  
  <pre><code>class Parent
  {
      int ParentId (identity column) { get; set; }
      string ParentName { get; set; }
      virtual ICollection&lt;Child&gt; Children { get; set; }
  }
  
  class Child
  {
      int ChildId (identity column) { get; set; }
      string ChildName { get; set; }
      int ParentID { get ; set; } //foreign key to Parent(ParentID)
  }
  </code></pre>
  
  <p>How do i insert few rows to my parent and child in single transaction? Basically i want to get the identity generated on the parent(say i insert a row in parent) and insert child rows with that value?
  How this can be achieved using Code First?</p>