SyntaxFix
Write A Post
Hire A Developer
Questions
In entity framework, when object is added to context, its state changes to Added. EF also changes state of each object to added in object tree and hence you are either getting primary key violation error or duplicate records are added in table.