How to Repair the System There is no key for Data.Edm.EdmEntityType.

.net asp.net-mvc entity-framework linq

Question

Does anybody know how to correct this issue?

System.Data.Edm.EdmEntityType: : EntityType 'BlogTags' has no key defined. Define the key for this EntityType.

Utilizing Entity Framework and MVC 3.

1
14
8/1/2013 3:30:52 PM

Accepted Answer

The error message, "Define the key for this EntityType," has all the information you want.

All entities in EF are required to have some kind of primary key.

5
3/11/2011 8:14:36 PM

Popular Answer

Simply place [Key] above your property (which is presenting primary key). comparable to this

[Key]
public int BlogTypeId { get; set; }


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow