How do I get my DataBase First EF 6.1 Entities to

2019-08-29 12:01发布

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.

1条回答
Juvenile、少年°
2楼-- · 2019-08-29 12:13

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

查看更多
登录 后发表回答