据这里的博客文章数据注释中的实体框架应该有一个名为键栏中,它允许您标记一个实体的主键的属性。不过,我不能在.NET 3.5中或.Net 4.0查找此。
According to the blog post here Data Annotations in the Entity Framework there should be an attribute for a column called "Key" which allows you to mark the primary key of an entity. However I cannot locate this in .Net 3.5 or .Net 4.0.
我有什么遗漏?我已经包括了参考EntityFramework.dll,我已经检查了所有的属性在 System.ComponentModel.DataAnnotations
但我不能找到它。
What have I missed? I've included the reference to EntityFramework.dll and I've checked all the attributes under System.ComponentModel.DataAnnotations
but I cannot locate it.
我已经把我的项目到.NET 4.0全(不是客户端配置文件)。
I have set my project to .Net 4.0 full (not client profile).
任何想法?
推荐答案
的KeyAttribute .NET是唯一的4,它位于 System.ComponentModel.DataAnnotations
组装所以一定要确保你已经提到了。
The KeyAttribute is .NET 4 only and it is located in the System.ComponentModel.DataAnnotations
assembly so make sure you have referenced it.
相关推荐
最新文章