EntityState enum

The state of a TrackedEntry in the change tracker.

State transitions:

  • (none)detached (entity has no entry).
  • detachedadded on DbSet.add.
  • detachedmodified on DbSet.markModified.
  • detachedremoved on DbSet.markDeleted.
  • addedunchanged on successful saveChanges.
  • modifiedunchanged on successful saveChanges.
  • removed(untracked) on successful saveChanges.
  • unchangedmodified on markModified.
Inheritance
Available extensions

Values

detached → const EntityState

The entity is not tracked (no entry in the ChangeTracker). The MVP DbSet does not expose markDetached directly — entries are created on add / markModified / markDeleted and removed on saveChanges. detached is the documented "no entry" sentinel used in API contracts.

added → const EntityState

The entity will be inserted by the next saveChanges. New entries start in this state.

unchanged → const EntityState

The entity is in sync with the database. Default state for entities loaded via findById / toList.

modified → const EntityState

The entity will be updated by the next saveChanges. The original values are stored in TrackedEntry.originalValues.

removed → const EntityState

The entity will be deleted by the next saveChanges.

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

values → const List<EntityState>
A constant List of the values in this enum, in order of their declaration.