开发者

Save a fetched entity in different context

开发者 https://www.devze.com 2022-12-10 05:56 出处:网络
I fetched an entity using a context. Then I made some changes to the entity an开发者_如何学Cd now I\'d like to save the entity using a different context. I use the AttachTo method but I\'m getting thi

I fetched an entity using a context. Then I made some changes to the entity an开发者_如何学Cd now I'd like to save the entity using a different context. I use the AttachTo method but I'm getting this error.

An entity object cannot be referenced by multiple instances of IEntityChangeTracker.


You must Detach before you can AttachTo.

That said, your life will be much simpler if you use only one context.

0

精彩评论

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