An object with the same key already exists in the ObjectStateManager. The existing object is in the Unchanged state.
An object can only be added to the ObjectStateManager again if it is in the added state
----------------------------------------------------------------------------------------------------------------------------------------------------报错原因:启用事件的时间,把主表添entities.AddToSTDPhrase(stdPhrase);
if (entities.SaveChanges() >= 1) 接着从表要 entities.AddToSTDPhraseItem(stdPhraseItem);
if (entities.SaveChanges() >= 1)
改为:两个对象都添加到容器中,一次性提交!