title: Multiple added entities may have the same primary key in Entity Framework
body: <p>I am working in a project using EF 4.0.</p>
  
  <p>The <code>Employee</code> table has a column <code>ReferEmployeeID</code> which contains the employee id of the employee that is referring a new employee in the system. So <code>Employee</code> is a self-referencing table.</p>
  
  <p>Now in the case of an employee who is not added to the system is about to add and he also refers another employee in the system, the row should be added altogether.</p>
  
  <p><code>ActualEmployee</code> save not called yet and then <code>ReferEmployee.Employee = ActualEmployee</code></p>
  
  <p>I understand the issue is that both the employees actual and refer has Employee ID set to 0, but how to come around this problem.</p>