Does anybody know how to fix this error:
System.Data.Edm.EdmEntityType: : EntityType \'BlogTags\' has no key defined. Define the key for this EntityTy
MVC3 will automatically recognize an entity's Key if it follows the convention 'Id' or 'EntityNameId'. Additionally, the entity must expose this as a PROPERTY AND it must be PUBLIC. I made the mistake of using protected for my property and got this error.
A good example is:
public int Id { get; set; }
OR
public int EntityNameId { get; set; }
Use the [Key] attribute if you can't follow this convention OR if you want to be very explicit in your code.