where is context.Entry()?

may be too late to answer but it may help others, EF 4.0 uses the ObjectContext class where as the version 4.1 uses the DbContext class in which the methods like Set<T> and Entry are defined. With version 4.0 you can do something like

DatabaseContext _context = new DatabaseContext();
_context.ObjectStateManager.ChangeObjectState(entity, System.Data.EntityState.Modified);

with version 4.1 its done like

_context.Entry(entity).State = System.Data.EntityState.Modified;

here is a useful SO link

Leave a Comment