EntityEntry.State EntityEntry.State EntityEntry.State Property


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 Microsoft.EntityFrameworkCore.EntityState State { get; set; }
member this.State : Microsoft.EntityFrameworkCore.EntityState with get, set
Public Overridable Property State As EntityState

Property Value

Applies to