Share via


EntityState Enum

Definition

Describes the state of an entity.

This enumeration supports a bitwise combination of its member values.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1714:FlagsEnumsShouldHavePluralNames")]
[System.Flags]
public enum EntityState
type EntityState = 
Public Enum EntityState
Inheritance
EntityState
Attributes

Fields

Name Value Description
Detached 1

The entity is not being tracked by the context. An entity is in this state immediately after it has been created with the new operator or with one of the DbSet Create methods.

Unchanged 2

The entity is being tracked by the context and exists in the database, and its property values have not changed from the values in the database.

Added 4

The entity is being tracked by the context but does not yet exist in the database.

Deleted 8

The entity is being tracked by the context and exists in the database, but has been marked for deletion from the database the next time SaveChanges is called.

Modified 16

The entity is being tracked by the context and exists in the database, and some or all of its property values have been modified.

Applies to