< add key=“CachingMode” value=“OverwriteChanges”/>

This key serves to set the system wide caching behavior.

Default: NoTracking
Acceptable Values: AppendOnly, OverwriteChanges, PreserveChanges, NoTracking

AppendOnly:
Objects that do not exist in the object context are attached to the context.
If an object is already in the context, the current and original values of object’s
properties in the entry are not overwritten with data source values. The state
of the object’s entry and state of properties of the object in the entry do not
change. System.Data.Objects.MergeOption.AppendOnly is the default merge option.

OverwriteChanges:
Objects that do not exist in the object context are attached to the context.
If an object is already in the context, the current and original values of object’s
properties in the entry are overwritten with data source values. The state of
the object’s entry is set to System.Data.EntityState.Unchanged, no properties
are marked as modified.

PreserveChanges:
Objects that do not exist in the object context are attached to the context.

NoTracking:
Objects are maintained in a System.Data.EntityState.Detached state and are not
tracked in the System.Data.Objects.ObjectStateManager. However, Entity Framework-generated
entities and POCO entities with proxies maintain a reference to the object context
to facilitate loading of related objects.

More information can be found here: MSDN

Revision: 1
Last modified: Aug 29, 2019

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment