Class IgnoringIdentityResolutionInterceptor
- Namespace
- Microsoft.EntityFrameworkCore.Diagnostics
- Assembly
- Microsoft.EntityFrameworkCore.dll
A IIdentityResolutionInterceptor that ignores the new instance and retains property values from the existing tracked instance.
public class IgnoringIdentityResolutionInterceptor : IIdentityResolutionInterceptor, IInterceptor
- Inheritance
-
IgnoringIdentityResolutionInterceptor
- Implements
- Inherited Members
Constructors
IgnoringIdentityResolutionInterceptor()
public IgnoringIdentityResolutionInterceptor()
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 does nothing, such that property values from the existing tracked instance are retained.
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.