i\'m using Entity Framework 4.0 and having a silly problem that i can\'t figure out.
I have two tables:
I had this happening when I was editing related objects from two separate contexts at the same time. Example:
DataContext ctxA = new DataContext();
DataContext ctxB = new DataContext();
Author orwell = new Author {Name = "George Orwell" };
ctxA.Add(orwell);
ctxB.Add(new Book {Name = "1984", Author = orwell});
ctxA.SaveChanges();
ctxB.SaveChanges();
My case was a little bit more convoluted (as this is obviously quite stupid) but in essence this was causing the error in my case.