Entity FrameworkManaging entity state


Remarks

Entities in Entity Framework can have various states that are listed by the System.Data.Entity.EntityState enumeration. These states are:

Added    
Deleted    
Detached    
Modified    
Unchanged

Entity Framework works with POCOs. That means that entities are simple classes that have no properties and methods to manage their own state. Entity state is managed by a context itself, in the ObjectStateManager.

This topic covers various ways to set entity state.