ChangeTracker.Entries<T> not returning entries with entities of Type T

谁说胖子不能爱 提交于 2019-12-11 15:11:39

问题


using EF 4.3.1 in SaveChanges(), i'm trying to get a list of all entries for entities which implement a specific interface. My entities implement multiple interfaces, one of which is IAuditable. The following doesn't return any entries, even though entries with entities of type IAuditable do exist.

 var auditableEntities =
                ChangeTracker.Entries<IAuditable>().Where(
                    e => e.State == EntityState.Modified | e.State == EntityState.Added);

来源:https://stackoverflow.com/questions/12970257/changetracker-entriest-not-returning-entries-with-entities-of-type-t

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!