How to get the bottom of this Linq to SQL error?

An attempt was made to connect or Add an entity that is not new, possibly being loaded from another DataContext. This is not supported.

Having been working with Linq to SQL for some time, I believe that I know about its limitations and that I follow the rules when writing new code. But this exception is a disappointment, as there is no indication of which object caused the violation. In complex data processing scenarios with multiple domain controllers, I can only think of trial errors to narrow down the possible culprits. Is there any way to find out more?

+1
source share
1 answer

DataContext, . DataContext, DataContext.

, DataContext, " ".

, , , , , DataContext. , DataContext.

Linq to SQL , , , , . , DataContexts. ( , "" "" ), .

0

Source: https://habr.com/ru/post/1726254/


All Articles