Search code examples
linqverifysubmitchanges

Linq: How to verify dbcontext.SubmitChanges() for updates/inserts succeeded?


How do you verify that SubmitChanges() worked for inserts and updates? The method doesn't return a bool or int value.


Solution

  • If an insert fails it will throw a SqlException. I think it may do the same for failed updates.