Setting Entity Framework MergeOptions – What Works, What Doesn’t

The Basics When retrieving entities using object queries with the Entity Framework, there is a MergeOption setting that allows you to specify how you want entities to be retrieved. The default value is AppendOnly, which specifiies that if an entity already exists in the ObjectContext, to retrieve it from there. Otherwise, it is retrieved from the database. This means that if you retrieve an entity, change some of its property values and then retrieve it again from the ObjectContext, you will not get a fresh copy from the database–you’ll get the cached object in the ObjectContext. For a great explanation … Continue reading Setting Entity Framework MergeOptions – What Works, What Doesn’t