entity framework update foreign key throws exception if AutoDetectChangesEnabled set false -


i have table , b : id name bid b : id type

in table has data record reference b1,now want update reference b2. in unitofwork if set autodetectchangesenabled = true it's work ok, set autodetectchangesenabled = false reason want speed throw exception this: changes database committed successfully, error occurred while updating object context. objectcontext might in inconsistent state. inner exception message: referential integrity constraint violation occurred: property value(s) of 'goodskind.goods_kind_id' on 1 end of relationship not match property value(s) of 'enrolmenttype.goods_kind' on other end."

how cand do?

i had error well. problem me have complex type. when changed master record (let's person) wanted change complex type list contact information(s). when tried save them both in 1 screen got error. check if fill ids on screen master record , complex type records. check if posted server (if use in example mvc). can checking bind statement mvc action.


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -