摘要: 如上图,vs2012+Entity Framework 如果对应的实体类(entity)字段没有添加属性[key],[Required] 会提示 :has not keys defined下面这样是ok的。 public class MovieEntry { [Key] public int Id{get;set;} [Required] public string Topic { get; set; } public string direct { get; set; } public DateTime Release { get; set; } } 阅读全文
posted @ 2013-03-11 15:32 墨尔 阅读(821) 评论(0) 推荐(0) 编辑