未能找到类型或命名空间名称“ForeignKey”(是否缺少 using 指令或程序集引用?)

2025-06-23 02:14:08
推荐回答(2个)
回答1:

根据msdn,命名空间是System.ComponentModel.DataAnnotations.Schema
dll是System.ComponentModel.DataAnnotations.dll
看看是否引用了。

回答2:

http://www.cnblogs.com/firstcsharp/archive/2013/03/19/2968896.html