How to update ALL the dirty entities from the data store, and reset their changed values to the original store value?
The method ObjectContext.Refresh requires as a parameter the entities to be refreshed.
How to update ALL the dirty entities from the data store, and reset their changed values to the original store value?
The method ObjectContext.Refresh requires as a parameter the entities to be refreshed.
If you want to reset ALL the changes, you could set the ObjectContext
to null and re-instantiate it.
I believe this will achieve what you want.
Kindness,
Dan
The following usually works:
Context.Refresh(RefreshMode.StoreWins, _
Context.ObjectStateManager.GetObjectStateEntries())
It sometimes causes problems with EntityRelations. look at my comment for further details.