This documentation is archived and is not being maintained.
EntityState Enumeration
Visual Studio 2008
The state of an entity object.
This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.
Namespace: System.DataAssembly: System.Data.Entity (in System.Data.Entity.dll)
| Member name | Description | |
|---|---|---|
| Detached | The object exists but it is not being tracked by Object Services. An entity is in this state immediately after it has been created and before it is added to the object context. An entity is also in this state after it has been removed from the context by calling the Detach method or if it is loaded using a NoTrackingMergeOption. | |
| Unchanged | The object has not been modified since it was loaded into the context or since the last time that the SaveChanges method was called. | |
| Added | The object is added to the object context and the SaveChanges method has not been called. Objects are added to the object context by calling the AddObject method. | |
| Deleted | The object is deleted from the object context by using the DeleteObject method. | |
| Modified | The object is changed but the SaveChanges method has not been called. |
The state of objects inside an object context is managed by the ObjectStateManager.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: