Project 1 uses the DbContext
API because only this context type has an Entry
method.
Project 2 most likely uses ObjectContext
with entities derived from EntityObject
and Customer
inherits the EntityState
from there. If Customer
has a custom EntityState
property, it's not possible to distinguish with your single line. Hit F12 twice - once on the customer
variable which directs you to the declaration and then on the type (probably Customer
) of that variable to see the class declaration and to check if it derives from EntityObject
.
The fact that the EF5 assembly in Project 2 is referenced means nothing. It might be unused in the code or the code only uses a few helper methods (like the lambda version of Include
), but it doesn't seem to use all the core features of DbContext
. It will reference the EF classes in the .NET framework assemblies (System.Data.Entity.dll
, etc.).
Upgrading project 2 is worth to consider because all newer development of EF follows the POCO approach (instead of the EntityObject
approach).