I am working on a WPF application using Entity Framework 4.0. When I tried to save the object, I got a primary key exception, but the primary key is an AutoIncremented field
In my case I had collections that were manually populated from a different context (different database). In order to prevent my main context from trying to save these collections I ended up adding