|
One or more validation errors were detected during model generation:
System.Data.Edm.EdmEntityType: : EntityType 'Consultation' has no key defined. Define the key for this EntityType.
System.Data.Edm.EdmEntitySet: EntityType: EntitySet ?Consultations? is based on type ?Consultation? that has no keys defined.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.Entity.ModelConfiguration.ModelValidationException: One or more validation errors were detected during model generation:
System.Data.Edm.EdmEntityType: : EntityType 'Consultation' has no key defined. Define the key for this EntityType.
System.Data.Edm.EdmEntitySet: EntityType: EntitySet ?Consultations? is based on type ?Consultation? that has no keys defined.
Solution:
Just put [Key] on top of your property (which is presenting primary key). Something like this,
[Key]
public int BlogTypeId { get; set; }
|