开发者

How to detach an ObjectGraph from the Entity Framework Context?

开发者 https://www.devze.com 2023-01-12 21:38 出处:网络
I need a solution on detaching an Entity and his child records from a context. If i try to detach the parent entity only from a List<> i queried with LINQ to Entities

I need a solution on detaching an Entity and his child records from a context. If i try to detach the parent entity only from a List<> i queried with LINQ to Entities i lose the child records. If i try to enumerate through the child records and detach them i ge开发者_运维百科t an InvalidOperationException.

Is there a solution i miss?


Take a look at the answer by Alex James here.
Maybe this article will also be helpful.

0

精彩评论

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