Marius Gheorghe

Building software : make it work, make it good, make it fast

Documentation error in EntityFramework

Here's the description for entityCollection.Load(MergeOption.OverwriteChanges);

 "Objects are always loaded from the persisted store. Any property changes made to objects in the object context are overwritten by the store values."

 

Wrong.

If you add an item to the entity collection and then call Load(MergeOption.OverwriteChnages), you will STILL find that item there. To get data from database, you'll need to do :

entityCollection.Clear();

entityCollection.Load(MergeOption.OverwriteChanges);