Sugerir traducción
 
Otros han sugerido:

progress indicator
No hay más sugerencias.
Evaluar y enviar comentarios
MSDN
MSDN Library
System.Data
 EntityState (Enumeración)
Contraer todo/Expandir todo Contraer todo
Ver contenido:  en paraleloVer contenido: en paralelo
.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)
Visual Basic
<FlagsAttribute> _
Public Enumeration EntityState
C#
[FlagsAttribute]
public enum EntityState
Visual C++
[FlagsAttribute]
public enum class EntityState
F#
[<FlagsAttribute>]
type EntityState
Member nameDescription
DetachedThe 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.
UnchangedThe object has not been modified since it was attached to the context or since the last time that the SaveChanges method was called.
AddedThe 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.
DeletedThe object has been deleted from the object context. After the changes are saved, the object state changes to Detached.
ModifiedOne 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.

The object context must know the state of an object to save changes back to the data source. ObjectStateEntry objects store EntityState information. The SaveChanges methods of the ObjectContext process entities that are attached to the context and update the data source depending on the EntityState of each object. For more information, see Adding, Modifying, and Deleting Objects.

The state of objects inside an object context is managed by the ObjectStateManager. To find out the state of an object, call one of the following ObjectStateManager methods: TryGetObjectStateEntry, GetObjectStateEntry, or GetObjectStateEntries. The State property of the ObjectStateEntry defines the state of the object.

.NET Framework

Supported in: 4, 3.5 SP1

.NET Framework Client Profile

Supported in: 4

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.
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)
Visual Basic
<FlagsAttribute> _
Public Enumeration EntityState
C#
[FlagsAttribute]
public enum EntityState
Visual C++
[FlagsAttribute]
public enum class EntityState
F#
[<FlagsAttribute>]
type EntityState
Nombre de miembroDescripción
DetachedEl 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.
UnchangedEl objeto no se ha modificado desde que se adjuntó al contexto o desde la última vez que se llamó al método SaveChanges.
AddedEl 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.
DeletedEl objeto se ha eliminado del contexto del objeto. Una vez guardados los cambios, el estado del objeto cambia a Detached.
ModifiedSe 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.

El contexto del objeto debe saber cuál es el estado de un objeto para guardar los cambios del objeto de nuevo en el origen de datos. Información EntityState del almacén de objetos ObjectStateEntry. Los métodos SaveChanges de ObjectContext procesan entidades que se adjuntan al contexto y actualizan el origen de datos que depende de EntityState de cada objeto. Para obtener más información, vea Adding, Modifying, and Deleting Objects.

El ObjectStateManager administra el estado de los objetos dentro de un contexto del objeto. Para conocer el estado de un objeto, llamea uno de estos métodos ObjectStateManager: TryGetObjectStateEntry, GetObjectStateEntry o GetObjectStateEntries. La propiedad State de ObjectStateEntry define el estado del objeto.

.NET Framework

Compatible con: 4, 3.5 SP1

.NET Framework Client Profile

Compatible con: 4

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.
Contenido de la comunidad   ¿Qué es Community Content?
Agregar contenido nuevo RSS  Anotaciones
Processing
© 2012 Microsoft. Reservados todos los derechos. Términos de uso | Marcas Registradas | Privacidad
Page view tracker