報錯: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

相关文章:

  • 2022-12-23
  • 2021-06-09
  • 2021-12-19
  • 2022-12-23
  • 2021-08-24
  • 2021-08-05
猜你喜欢
  • 2022-12-23
  • 2021-10-05
  • 2022-02-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-08
相关资源
相似解决方案