开发者

Entity Framework Object being added but never commited to database

开发者 https://www.devze.com 2023-02-11 05:31 出处:网络
I\'ve been asked to fix a problem with a WCF service that uses the entity framework for it\'s data access. Adds of a whole object work great, but updates fail because one object isn\'t being detected.

I've been asked to fix a problem with a WCF service that uses the entity framework for it's data access. Adds of a whole object work great, but updates fail because one object isn't being detected.

Object model is like so Parent -> Collection Of Children -> Collection of Children -> Child Object

The Child object is the one that isn't being saved. I see that it is in the added state in the ObjectStateManager, but because it's parent didn't change, the chan开发者_运维知识库ge doesn't seem to go to the database. If I add a new object to the Child Object's collection and a Child Object it picks up the change and saves it to the database, but if the parent collection doesn't change, it won't ever submit the changes to the database.

What am I missing?

0

精彩评论

暂无评论...
验证码 换一张
取 消