ChangeTracker.HasChanges Method

Definition

Checks if any new, deleted, or changed entities are being tracked such that these changes will be sent to the database if SaveChanges() or SaveChangesAsync(CancellationToken) is called.

public virtual bool HasChanges ();
abstract member HasChanges : unit -> bool
override this.HasChanges : unit -> bool
Public Overridable Function HasChanges () As Boolean

Returns

Boolean

true if there are changes to save, otherwise false.

Remarks

Note that this method calls DetectChanges() unless AutoDetectChangesEnabled has been set to false.

Applies to