EntityState enum
The state of a TrackedEntry in the change tracker.
State transitions:
(none)→detached(entity has no entry).detached→addedonDbSet.add.detached→modifiedonDbSet.markModified.detached→removedonDbSet.markDeleted.added→unchangedon successfulsaveChanges.modified→unchangedon successfulsaveChanges.removed→(untracked)on successfulsaveChanges.unchanged→modifiedonmarkModified.
Values
- detached → const EntityState
-
The entity is not tracked (no entry in the ChangeTracker). The MVP
DbSetdoes not exposemarkDetacheddirectly — entries are created onadd/markModified/markDeletedand removed onsaveChanges.detachedis 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.