Model updates to contained collection not saved in DB when saving parent entity?

早过忘川 提交于 2019-12-05 21:04:35

Setting db.Entry(p).State = EntityState.Modified; you only set the parent entity to modified. To also modify the navigational properties you have to mark them all as modified.

So something like: p.CaseRefs.ForEach(c => db.Entry(c).State = EntityState.Modified);

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!