Most often when you want to interact with an object’s state, or change tracking information you cannot do that through the object itself. Instead you need to get at the ObjectStateEntry which the context created to manage the object. Inside the the ObjectStateEntry you have access to the current values, the original values, the EntityState (that property is exposed through EntityObject) and the ability to modify the state. In fact, in EF4, there's a new ObjectStateEntry method called ChangeState which is extremely useful..
Many people wonder why we can’t do this type of action directly on the object.
With the new POCO capabilities, the answer becomes more obvious. POCO objects will have no concept of the Entity Framework. They will not be inheriting from EntityObject or implementing any of EF’s interfaces. These classes will have no way to get at the properties or methods that are provide through the Entity Framework.
However, when these POCO classes are being managed by the ObjectContext, the context will create an ObjectStateEntry for each one of the objects. So whether the object inherits from EntityObject, implements some of the EF interfaces or has not ties whatsoever to EF, you will still have all of the functionality provided through the ObjectStateEntries. Therefore it makes a lot more sense that the functionality is bound to that type, rather than to the classes you are using to describe your entities.




