Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

There is no Key attribute in EF CTP 5

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.

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. alt text

I have set my project to .Net 4.0 full (not client profile).

Any ideas?

like image 977
Spence Avatar asked Nov 30 '22 17:11

Spence


1 Answers

The KeyAttribute is .NET 4 only and it is located in the System.ComponentModel.DataAnnotations assembly so make sure you have referenced it.

like image 156
Darin Dimitrov Avatar answered Dec 02 '22 06:12

Darin Dimitrov