Entity Framework 4.0 GetChanges() equivalent
In LINQ to SQL, you can override SubmitChange开发者_开发知识库s and use the method this.GetChangeSet() to get all the inserts, updates and deletes so that you can make last minute changes before it is committed to the database.
Can this be done in EF 4.0? I see there is a override for SaveChanges but I need to know the equivalent for GetChangeSet()
Found it.
ObjectContext.ObjectStateManager.GetObjectStateEntries(System.Data.EntityState.Added); for inserts.
精彩评论