我的实体是由EF设计师创建的,具有没有修改。我遵循编程实体框架中的步骤:DbContext,但我的实体似乎没有继承IEntitiyWithChangeTracker(尽管它们实际上是DynamicProxies)。
任何人都可以列举步骤由DataBase First EF 6.1设计人员创建的实体变为跟踪代理?我认为修改类必须在设计师之外进行,否则就不会自动。
解决方案所以答案在于对IEntityWithChangeTracker使用正确的命名空间。在EF6.x中,如果使用System.Data.Entity.Core.Objects.DataClasses.IEntityWithChangeTracker测试,您的实体将返回true。感谢MSFT的Fred Bao
I'm struggling to get my model's entities to be change tracker proxies rather than utilize snap shot change detection.
My entities are created by the EF designer and have been otherwise unmodified. I followed the steps in Programming Entity Framework: DbContext but my entities never seem to inherit the IEntitiyWithChangeTracker (though they are in fact DynamicProxies).
Can anyone enumerate the steps to make an entity created by the DataBase First EF 6.1 designer into a change tracker proxy? I assume that modification of the classes must be made outside the designer, nothing will be automatic.
解决方案So, the answer lies in using the correct Namespace for IEntityWithChangeTracker. In EF6.x if you test with System.Data.Entity.Core.Objects.DataClasses.IEntityWithChangeTracker your entity will return true. Thanks Fred Bao of MSFT
更多推荐
如何让我的DataBase First EF 6.1实体变成跟踪代理
发布评论