开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜