.NET Framework Class Library EntityState Enumeration The state of an entity object. This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.
Namespace:
System.Data
Assembly:
System.Data.Entity (in System.Data.Entity.dll)

Syntax
<FlagsAttribute> _
Public Enumeration EntityState
[FlagsAttribute]
public enum EntityState
[FlagsAttribute]
public enum class EntityState
[<FlagsAttribute>]
type EntityState

Members
| Member name | Description |
|---|
| Detached | The object exists but is not being tracked. 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 by using a NoTracking MergeOption. There is no ObjectStateEntry instance associated with objects in the Detached state. | | Unchanged | The object has not been modified since it was attached to the context or since the last time that the SaveChanges method was called. | | Added | The object is new, has been added to the object context, and the SaveChanges method has not been called. After the changes are saved, the object state changes to Unchanged. Objects in the Added state do not have original values in the ObjectStateEntry. | | Deleted | The object has been deleted from the object context. After the changes are saved, the object state changes to Detached. | | Modified | One of the scalar properties on the object was modified and the SaveChanges method has not been called. In POCO entities without change-tracking proxies, the state of the modified properties changes to Modified when the DetectChanges method is called. After the changes are saved, the object state changes to Unchanged. |

Remarks

Version Information
.NET FrameworkSupported in: 4, 3.5 SP1 .NET Framework Client ProfileSupported in: 4

Platforms
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role not supported), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

See Also
|
Biblioteca de clases de .NET Framework EntityState (Enumeración) Estado de un objeto entidad. Esta enumeración tiene un atributo FlagsAttribute que permite una combinación bit a bit de los valores de miembro.
Espacio de nombres:
System.Data
Ensamblado:
System.Data.Entity (en System.Data.Entity.dll)

Sintaxis
<FlagsAttribute> _
Public Enumeration EntityState
[FlagsAttribute]
public enum EntityState
[FlagsAttribute]
public enum class EntityState
[<FlagsAttribute>]
type EntityState

Miembros
| Nombre de miembro | Descripción |
|---|
| Detached | El objeto existe pero no se está haciendo un seguimiento de él. Una entidad está en este estado inmediatamente después de crearla y antes de agregarla al contexto del objeto. Una entidad también está en este estado después de quitarla del contexto mediante una llamada al método Detach o si se carga mediante NoTracking MergeOption. No hay ninguna instancia de ObjectStateEntry asociada a objetos en estado Detached. | | Unchanged | El objeto no se ha modificado desde que se adjuntó al contexto o desde la última vez que se llamó al método SaveChanges. | | Added | El objeto es nuevo, se ha agregado al contexto del objeto y no se ha llamado al método SaveChanges. Una vez guardados los cambios, el estado del objeto cambia a Unchanged. Los objetos que están en el estado Added no tienen valores originales en ObjectStateEntry. | | Deleted | El objeto se ha eliminado del contexto del objeto. Una vez guardados los cambios, el estado del objeto cambia a Detached. | | Modified | Se ha modificado una de las propiedades escalares del objeto y no se ha llamado al método SaveChanges. En entidades POCO sin proxys de seguimiento de cambios, el estado de las propiedades modificadas cambia a Modified cuando se llama al método DetectChanges. Una vez guardados los cambios, el estado del objeto cambia a Unchanged. |

Comentarios

Información de versión
.NET FrameworkCompatible con: 4, 3.5 SP1 .NET Framework Client ProfileCompatible con: 4

Plataformas
Windows 7, Windows Vista SP1 o posterior, Windows XP SP3, Windows Server 2008 (no se admite Server Core), Windows Server 2008 R2 (se admite Server Core con SP1 o posterior), Windows Server 2003 SP2
.NET Framework no admite todas las versiones de todas las plataformas. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.

Vea también
|