Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error 3027: No mapping specified for the following EntitySet/AssociationSet [closed]

I am using EntityFramework 6 and I used Update Model from Database after inserting table in the database, I got above error.Please state how to overcome this problem.

like image 231
user5014787 Avatar asked Jun 17 '15 05:06

user5014787


5 Answers

Open the edmx file on notepad, find the unmapping association and remove it. It should work.

like image 195
Junior Avatar answered Nov 14 '22 10:11

Junior


Not too satisfying, but I solved it by removing and re-adding the model:

  1. Right-click on edmx-diagram and select "Model browser"
  2. Remove the entity type that's giving the problems
  3. Save (just to be sure, regenerates files)
  4. Add model from databasetable again and save.

The warning was gone afterwards.

like image 20
Laurens B Avatar answered Nov 14 '22 11:11

Laurens B


I got the same error and found that the foreign key in the table I had added was not of the same type as in the referenced table.

like image 3
Rune Jeppesen Avatar answered Nov 14 '22 10:11

Rune Jeppesen


Here how I fix this:

  1. Remove all the entities in your Diagram in your edmx file.
  2. Rebuild your project if this edmx file is part of a project in your solution.
  3. Rebuild your solution.

I am not sure why this happens but on my part, it consistently triggers this error when I update my database, and I didn't update my edmx file.

like image 2
Willy David Jr Avatar answered Nov 14 '22 12:11

Willy David Jr


Try removing entity (table) from EDMX then run update to add that table again.

like image 2
ForcedFakeLaugh Avatar answered Nov 14 '22 10:11

ForcedFakeLaugh