Error 3027: mapping not defined for next EntitySet / AssociationSet

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

0
sql-server entity-framework-6
Jun 17 '15 at 5:28
source share
5 answers

Open the edmx file in notepad and find the inconsistent association and delete it. It should work.

+4
Oct 17 '16 at 12:06 on
source share

Sometimes there is a problem in the Entity Framework when updating tables, then other objects, such as SP, are automatically updated. Please make sure that this does not happen in your case. Another thing you can try is to replace the model.tt file with a new one to achieve this,

  • Right-click anywhere in your edmx file.
  • Select "Add Code Generation Item."
  • Select "EF 6.x EntityObject Generator".
  • Change the name from "Model2.tt" to "Model1.tt" (if your old model file name was model1.tt).
  • Click Add.
0
Jun 17 '15 at 5:42 on
source share

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

0
Jan 25 '17 at 13:59 on
source share

Not too satisfactory, but I solved this by deleting and re-adding the model:

  • Right-click on the edmx chart and select Model Browser
  • Remove the type of object that is causing the problems.
  • Save (just to restore files)
  • Add the model from the database again and save.

After that, the warning disappeared.

0
Mar 29 '17 at 10:59 on
source share

Delete and re-add tables to EDMX to fix the display problem.

0
Sep 13 '17 at 9:46 on
source share



All Articles