码迷,mamicode.com
首页 > 其他好文 > 详细

報錯:One or more validation errors were detected during model generation:System.Data.Edm.EdmEntityType: : EntityType 'Movie' has no key

时间:2014-10-28 13:28:44      阅读:196      评论:0      收藏:0      [点我收藏+]

标签:io   for   sp   数据   on   bs   ef   as   数据库   

報錯:One or more validation errors were detected during model generation:System.Data.Edm.EdmEntityType: : EntityType ‘Movie‘ has no key defined. Define the key for this EntityType.

 

 

解决方法,看你报错的那个表,然后添加一个一个主键标识  [Key],以及引用一下using System.ComponentModel.DataAnnotations;

一定要记得类名和数据库表名字是有单复数之别的,比如我的Movie.cs,数据库中表名是Movies

報錯:One or more validation errors were detected during model generation:System.Data.Edm.EdmEntityType: : EntityType 'Movie' has no key

标签:io   for   sp   数据   on   bs   ef   as   数据库   

原文地址:http://www.cnblogs.com/azzhang/p/4056418.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!