ChangeTracker.StateChanging Event
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
An event fired when an entity that is tracked by the associated DbContext is moving from one EntityState to another.
public event EventHandler<Microsoft.EntityFrameworkCore.ChangeTracking.EntityStateChangingEventArgs> StateChanging;
member this.StateChanging : EventHandler<Microsoft.EntityFrameworkCore.ChangeTracking.EntityStateChangingEventArgs>
Public Custom Event StateChanging As EventHandler(Of EntityStateChangingEventArgs)
Event Type
Remarks
Note that this event does not fire for entities when they are first tracked by the context. Use the Tracking event to get notified when the context begins tracking an entity.
See EF Core change tracking for more information and examples.
Applies to
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Entity Framework