Export (0) Print
Expand All

EntityState Enumeration

[This page is specific to the Entity Framework version 6. The latest version is available as the 'Entity Framework' NuGet package. For more information about Entity Framework, see msdn.com/data/ef.]

Describes the state of an entity.

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

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

[FlagsAttribute]
[SuppressMessageAttribute("Microsoft.Naming", "CA1714:FlagsEnumsShouldHavePluralNames")]
public enum EntityState

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

Deleted 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.

Detached 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.

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

Unchanged 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.

Show:
© 2014 Microsoft