2013-01-04 24 views
1

下面的代码:无法更新EntitySet的

sistema_log_openedPdfs entity = new sistema_log_openedPdfs(); 
entity.idUser = guid; 
entity.path = fullAbsPath; 
context.sistema_log_openedPdfs.Add(entity); 
context.SaveChanges(); 

我得到这个疯狂的例外:

[UpdateException: Unable to update the EntitySet 'sistema_log_openedPdfs because it has a DefiningQuery and no <InsertFunction> element exists in the<ModificationFunctionMapping> element to support the current operation.]

Lokking的帮助我无法找到任何帮助。

回答

2

你忘了为主要关键字sistema_log_openedPdfs ???

+0

是的,主键没有被创建。谢谢 –

+0

很高兴帮助:) –