Entity framework Azure移动应用程序-实体框架-缺少外键和其他属性
在Azure移动应用程序中,我试图向我的DataObject类添加外键属性 似乎任何属性都无法识别,我得到一个错误消息Entity framework Azure移动应用程序-实体框架-缺少外键和其他属性,entity-framework,azure,foreign-keys,azure-mobile-services,Entity Framework,Azure,Foreign Keys,Azure Mobile Services,在Azure移动应用程序中,我试图向我的DataObject类添加外键属性 似乎任何属性都无法识别,我得到一个错误消息 using Microsoft.Azure.Mobile.Server; using System.ComponentModel.DataAnnotations.Schema; namespace SomeNameSpace.DataObjects { [ForeignKey("examplekeyname")] public string SomeDat
using Microsoft.Azure.Mobile.Server;
using System.ComponentModel.DataAnnotations.Schema;
namespace SomeNameSpace.DataObjects
{
[ForeignKey("examplekeyname")]
public string SomeDataColmnName {get; set;}
我以前做过这件事,所以我不知道是什么原因造成的
再次阅读了几个Azure移动应用程序教程,但似乎不起作用
我收到以下错误消息:
错误CS0246找不到类型或命名空间名称“ForeignKeyAttribute” (是否缺少using指令或程序集引用?)
这不仅仅是外键。。其他属性显示相同的行为。。。与
[必需]
类似,这些属性位于assembly System.ComponentModel.DataAnnotations中。请参阅MSDN。再次感谢唐娜。似乎我必须1)添加System.ComponentModel.DataAnnotations作为对项目的引用,2)使用System.ComponentModel.DataAnnotations.Schema添加;