May 2010
Intermediate to advanced
1272 pages
61h 18m
English
Updating entities is a little bit different from adding and deleting in that there is no Update method in the ObjectContext. You simply get the instance of the object you want to update, change its properties, and then invoke SaveChanges. The following code demonstrates this:

Just remember to check if the product exists before trying an update. Notice also how an UpdateException is caught; this is thrown when there is some problem in sending updates to the data source.
Read now
Unlock full access