Posted on

Solving another error related to Entity Data Framework…

Indo Expatriate

It is frustrating if even after you have done unit testing to your program, there will be always another type of error when you try to execute it in real environment. After testing for around 2 weeks, I still deal with type of error which is probably first time to me. This morning when I created new console application in Visual C#, I encountered error stated An entity object cannot be referenced by multiple instances of IEntityChangeTracker.

It turned out that this error related to adding new record using Entity Data Framework. I actually have known how to add new instance into EDF before around 1 year ago. It just happened that after that, I never touched this thing since my last company only used .NET 2.0 for their website.

It took me quite a while before I realized the source of the error in the code below:

Adding EDF instance into DB

The commented…

View original post 86 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s