实体框架插入错误(“版本字段是必需的。”)
我正在使用 Silverlight 4 和 RIA 服务。当我尝试插入数据库时,出现以下错误:
“提交操作验证失败。请检查 EntitiesInError 中每个实体的 Entity.ValidationErrors 以获取更多信息。”
在检查 ValidationErrors 后,我看到:
“版本字段是必需的。”
Version字段不是由框架更新和维护的吗?如果是这样,为什么它是空的?如果没有的话我该如何设置呢?
I am using Silverlight 4 and RIA services. When I try to insert into my database, I get the following error:
"Submit operation failed validation. Please inspect Entity.ValidationErrors for each entity in EntitiesInError for more information."
Upon inspecting the ValidationErrors, I see:
"The Version field is required."
Isn't the Version field updated and maintained by the framework? If so, why is it null? If not, how am I supposed to set it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这显然是 Silverlight 4 中的一个错误。希望它能在最终版本中得到修复。
只需设置
[Entity].Version = new byte[0];
即可修复此问题。This is apparently a bug with in Silverlight 4. Hopefully it will be fixed in the final release.
It can be fixed by simply setting
[Entity].Version = new byte[0];
.