使用实体框架CTP 5我想在我的类中创建外键列表。 但我不断收到一个错误,称无法找到RelatedTo。实体框架CTP 5相关属性不起作用
下面是代码:
public class VertragsVerweis : GenericBLL
{
[Key]
public String Uid
{
get;
set;
}
public String VertagsVerweisNr
{
get;
set;
}
public String Bezeichnung
{
get;
set;
}
public Boolean Reparatur
{
get;
set;
}
[RelatedTo(RelatedProperty="Artikel")]
public List<Artikel> Artikelen
{
get;
set;
}
}
这给我的错误:
Error 2 The type or namespace name 'RelatedTo' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\wep\Bureaublad\WEPProject\branches\codefirst Entity Framework\BusinessLogic\BusinessLogic\VertragsVerweisBLL.cs 37 10 BusinessLogic
出于某种原因,它不承认从System.ComponentModel.DataAnnotations的关键属性。为什么它不识别RelatedTo?