01 August 2013

\tSystem.Data.Entity.Edm.EdmEntityType: : EntityType 'Context_Class' has no key defined. Define the key for this EntityType.

Have you experienced this:

\tSystem.Data.Entity.Edm.EdmEntityType: : EntityType 'Context_Class' has no key defined. Define the key for this EntityType.

A simple solution:

You should add attribute [Key] before the property Context_Id

[Key]
public virtual int Context_Id {get; set;}

No comments:

Post a Comment