EntityEntry.State EntityEntry.State Property

Definition

Gets or sets that state that this entity is being tracked in.

When setting the state, the entity will always end up in the specified state. For example, if you change the state to Deleted the entity will be marked for deletion regardless of its current state. This is different than calling Remove(TEntity) where the entity will be disconnected (rather than marked for deletion) if it is in the Added state.

public virtual EntityState State { get; set; }
Public Overridable Property State As EntityState

Property Value