Page 1 of 1

Update Related Entities

Posted: Wed 26 May 2010 02:48
by jacksparrow
We are using dotconnect for Oracle to generate our EDM for website.

The entities are detached since we pass them thru our service layer. We have a User table, with a foreign key to a Role table. When a User's role is updated the foreign key is not updated in the User Table.

The EDM generates a Role property and RoleReference property on the User Entity. When the SaveChanges method is called, the above two property changes are not propogated to the DB, since they are in Unchanged State (due to the dettached nature of the User Entity).

Posted: Fri 28 May 2010 07:44
by AndreyR
You should attach the deserialized object to the context in order to use the benefits of change tracking.
More information is available here in MSDN.