DbChangeTracker.HasChanges Method ()

 

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.

Namespace:   System.Data.Entity.Infrastructure
Assembly:  EntityFramework (in EntityFramework.dll)

public bool HasChanges()

Return Value

Type: System.Boolean

True if underlying DbContext have changes, else false.

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.