July 2015
Intermediate to advanced
1300 pages
87h 27m
English
Of course, the ADO.NET Entity Framework provides the ability to handle optimistic concurrency exceptions. You need to intercept eventual System.Data.Entity.Infrastructure.DbUpdateConcurrencyException instances. When intercepted, you need to determine what entries were not updated in the database by using the Entries property of the exception instance and make an appropriate decision. The following code revisits the UpdateProduct custom method described in the “Updating Entities” subsection, providing the first example:
Sub UpdateProduct() Try Dim check = northwindContext.Products. Single(Function(p) p. ProductName = "Italian spaghetti") ...