I know we can have access to the new/modified/deleted entities in OpenAccessContext by the following commands.
dbContext.GetChanges().GetInserts<object>()
dbContext.GetChanges().GetUpdates<object>()
dbContext.GetChanges().GetDeletes<object>()
If an execption occures for any reasons while perfoming SaveChanges(), I need to log those entities but they get cleared in case of exceptions.
Is there anyway to get the entities out of OpenAccessContext in case on exceptions?
You could override the SaveChanges method like this:
When the savechanges failed, the changes are still accessible. You could also log the exception while you are at it.