In the last chapter we talked about retrieving entities from memory based on their state (using Local
or some very ugly ObjectContext
code), and in this chapter I’ve said that when an entity is part of an entity set, the context will maintain metadata indicating whether the entity is added, modified or deleted (or unchanged, of course). Let’s look at how that magic happens. As you’ve probably come to expect, the ObjectContext
and DbContext
maintain state using a slightly different API: