Class UpdatingIdentityResolutionInterceptor
- Namespace
- Microsoft.EntityFrameworkCore.Diagnostics
- Assembly
- Microsoft.EntityFrameworkCore.dll
A IIdentityResolutionInterceptor that copies property values from the new entity instance into the tracked entity instance.
public class UpdatingIdentityResolutionInterceptor : IIdentityResolutionInterceptor, IInterceptor
- Inheritance
-
UpdatingIdentityResolutionInterceptor
- Implements
- Inherited Members
Constructors
UpdatingIdentityResolutionInterceptor(bool, bool)
Creates a new instance of the interceptor.
public UpdatingIdentityResolutionInterceptor(bool preserveModifiedValues = false, bool updateOriginalValues = false)
Parameters
preserveModifiedValues
boolIf true, then values for properties marked as modified in the current instance will not be updated by values from the new instance.
updateOriginalValues
boolIf true, then both current and original values of the current instance are updated to current values from the new instance.
Methods
UpdateTrackedInstance(IdentityResolutionInterceptionData, EntityEntry, object)
Called when a DbContext attempts to track a new instance of an entity with the same primary key value as an already tracked instance. This implementation copies property values from the new entity instance into the tracked entity instance.
public virtual void UpdateTrackedInstance(IdentityResolutionInterceptionData interceptionData, EntityEntry existingEntry, object newEntity)
Parameters
interceptionData
IdentityResolutionInterceptionDataContextual information about the identity resolution.
existingEntry
EntityEntryThe entry for the existing tracked entity instance.
newEntity
objectThe new entity instance, which will be discarded after this call.