How to de-attach an entity from a Context in Entity Framework?
问题 I use EF 4.1 with Repository and DbContext.. POCO with T4 template. For every Repository I use a separate DbContext. I need to update an object with has a related property, at the moment I receive this error An entity object cannot be referenced by multiple instances of IEntityChangeTracker. I suppose my problem is beacuse eventObj and candidate are created from different Repositories. So i'm trying to solve the problem with this code, with no success. My question? How do I get rid of this