DbChangeTracker.HasChanges Method
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.
Checks if the DbContext is tracking any new, deleted, or changed entities or relationships that will be sent to the database if SaveChanges() is called.
public bool HasChanges ();
member this.HasChanges : unit -> bool
Public Function HasChanges () As Boolean
Returns
True if underlying DbContext have changes, else false.
Remarks
Functionally, calling this method is equivalent to checking if there are any entities or relationships in the Added, Updated, or Deleted state. Note that this method calls DetectChanges() unless AutoDetectChangesEnabled has been set to false.
Applies to
Entity Framework