This documentation is archived and is not being maintained.
MergeOption Enumeration
Visual Studio 2008
Specifies how objects being loaded into the object context are merged with objects already in the object context.
Assembly: System.Data.Entity (in System.Data.Entity.dll)
| Member name | Description | |
|---|---|---|
| AppendOnly | Objects that already exist in the object context are not loaded from the data source. This is the default behavior for queries or when calling the Load method on an EntityCollection(Of TEntity). | |
| OverwriteChanges | Objects are always loaded from the data source. Any property changes made to objects in the object context are overwritten by the data source values. | |
| PreserveChanges | Objects are always loaded from the data source. However, any property changes made to objects in the object context are preserved. | |
| NoTracking | Objects are maintained in a Detached state and are not tracked in the ObjectStateManager. |
PreserveChanges is used to force changes to objects in the object context to save successfully after an OptimisticConcurrencyException has occurred. For more information, see Saving Changes and Managing Concurrency (Entity Framework).
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: