I have an MVC2 application in which I am starting to use STE . I'm looking for some clarification on how updates should work.
Background:
If I have a Blog object with related category subjects and Related post / comment objects. In MVC, I present a view with the main blog object and categories, but not with related posts. When I submit a Blog object to the server, I see related categories, but not messages (because they were not in the view) in the entity that is serialized on the server. In addition, the Blog object has a change status of "Added."
Then I try to call Applychanges(), and SaveChanges()at the site blog for the update, and it fails because of the FK relationship with the messaging and the existence of related records in the database, but is not tied to I send back.
With further testing ... If I grab the current instance of the Blog object (with all associated FK objects) when connected to the server (state = unchanged), change the property (state = Modified) and update it to work as expected.
So my questions are:
If I have related objects that do not appear in the view and therefore do not come back with the Blog object, if the update works?
Blog "", ""? , , , ApplyChanges/SaveChanges(), , .
ApplyChanges()/SaveChanges(), , , ?