3
존재하는 엔티티를 첨부 할 수 없습니다 는 메시지를 받고, 이미 다음 코드를
이미 존재하는 개체를 첨부 할 수 없습니다.
C# 코드 :
var con = (from c in cmsContentTable where c.ContentName == contentId select c).FirstOrDefault();
cmsContentTable.Attach(con);
con.ContentData = "New Value";
cmsContentTable.Context.SubmitChanges();
왜이 오류를주고있다 -
var con = (from c in cmsContentTable where c.ContentName == contentId select c).FirstOrDefault();
이 완료 될 때 사기에 대한 참조가 이미 만들어졌다 때문에인가?
var con = (from c in cmsContentTable where c.ContentName == contentId select c).FirstOrDefault();
컨텍스트가 이미 객체에 '연결'되어 이미 테이블에서 항목을 받고 있기 때문에
이것을 ORM 프레임 워크에 태그하는 방법은 어떻습니까? – CodesInChaos
[이미 존재하는 엔티티를 연결할 수 없음] 가능한 복제본 (http://stackoverflow.com/questions/2605657/cannot-attach-anent-that-already-exists) –