SqlException Violation when try insert a related Entity

i have a problem when i create a new record in an entity an PK SqlException is thrown seems like Cuba try insert a Test for a second time instead insert only the translation.

I have a window to manage “templates”, “templates” have an related entity (Compositon) “Lab_Ensaios” and “Lab_Ensaios” have an related entity (composition) “Traducoes”.

when I try insert a new translation for a Test a exception is throw “SqlException: Violation of PRIMARY KEY contstraint ‘PK__LAB_ENSA__’ Cannot insert duplicate key in object ‘dbo.LAB_ENSAIOS’”.

Any suggetion?


Have you seen this document: Deep Composition?
If you are sure you have done everything right, please attach a test project demonstrating your problem.

Hi Konstantin,
Many thanks for your post solve my problem.

João Gomes