ASP.NET MVC – Attaching an entity of type ‘MODELNAME’ failed because another entity of the same type already has the same primary key value
Problem SOLVED! Attach method could potentially help somebody but it wouldn’t help in this situation as the document was already being tracked while being loaded in Edit GET controller function. Attach would throw exactly the same error. The issue I encounter here was caused by function canUserAccessA() which loads the A entity before updating the … Read more