Why is EF first inserting a child object (PersonnelWorkRecord) with a dependency, before the object that it is depended on (TimesheetActivity). Also what are
This may no longer be valid, however is it an option to use a transaction and adding each child object individually?
Note: I think Slauma's solution is more complete, however a transaction call may still be an option for others with similar issues.