Entity Framework inserting child objects in the wrong order

前端 未结 2 1262
故里飘歌
故里飘歌 2021-02-15 11:52

Question

Why is EF first inserting a child object (PersonnelWorkRecord) with a dependency, before the object that it is depended on (TimesheetActivity). Also what are

2条回答
  •  再見小時候
    2021-02-15 12:29

    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.

提交回复
热议问题