This problem usually occurs when you have a subtype table mapping, but its primary key is set to automatically create. this is problematic because EF will explicitly set the value based on the key of the root object.
If this is really a problem, then to solve it, set the " " parameter of your child table to false. i.e. remove from EDMX. Identity Specification StoreGeneratedPattern="identity"
source
share