Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

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

$
0
0

After reading many threads on this issue (including in this formum) I am still perplexed. I have a WPF application uing Code First EF (5.0).

The dbcontext is defined in a viewmodel class
that is instantiated when the MainWindow is first created. As far as I can tell, neither the viewmodel and is its associated instance of the context  go out of scope during the lifetime of the application, yet when I attempt to add an item to the database using the context I receive the "An entity object cannot be referenced by multiple instances of IEntityChangeTracker."

I would have thought that referencing the only context defined in the application would mean that is not possible to have multiple instances of  IEntityChangeTracker.

Any ideas?


Mike Agee


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>