有谁知道如何解决这个错误:
System.Data.Edm.EdmEntityType: : EntityType 'BlogTags' has no key defined. Define the key for this EntityType.
将 MVC 3 与 Entity Framework 结合使用。
最佳答案
只需将 [Key] 放在您的属性(property)顶部(显示主键)。像这样的事情,
[Key]
public int BlogTypeId { get; set; }
关于.net - 如何修复 System.Data.Edm.EdmEntityType 没有键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5277788/