【发布时间】:2015-10-21 01:53:29
【问题描述】:
在我的项目中,我使用 Entity framework 6 和 Breeze 来获取数据。 在客户端,我正在创建一个修改状态的微风实体,如下所示,
var entity = manager.createEntity(entityName);
entity.entityAspect.setModified();//Modifying the state
entity.Id(id);//pushing existing primary key value
entity.IfInactive(true); //updating the record value from false to true
saveChanges(msg).then(function () { //calling save changes
console.log('Success.');
});
但在 savechanges 期间,它会给出一个异常,例如“无法设置属性 'Id' 的原始值,因为该属性是实体键的一部分。”
提前致谢!
【问题讨论】: