Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Association end is not mapped in ADO entity framework

I am just starting out with ADO.net Entity Framework I have mapped two tables together and receive the following error:

Error   1   Error 11010: Association End 'OperatorAccess' is not mapped.    E:\Visual Studio\projects\Brandi II\Brandi II\Hospitals.edmx    390 11  Brandi II

Not sure what it is I am doing wrong.

I believe I can add some more clarity to the issue (learning as I go):

When I look at the Mapping details and look at the association, the column for operatoraccess table (from above) is blank and the drop down only includes field from the linked table.

alt text

like image 578
Sean Avatar asked Jan 15 '09 20:01

Sean


2 Answers

The Entity Framework designer is terrible - I've had the same problem many times (and your problem too, Craig):

This happens when you have a many-to-one association which is improperly setup. They could very easily fix the designer to make this process simple; but instead, we have to put up with this crap.


To fix:

  • Click on the association, and go to the mapping details view.
  • Under association, click on Maps to <tablename>. Choose the table(s) which make up the many side of the relationship (ie. the table(s) which make up the *-side of the association in the designer)
  • Under Column, choose the table-columns which map to each entity-side Property. You get this error when one of those entries are blank.
like image 81
BlueRaja - Danny Pflughoeft Avatar answered Nov 15 '22 20:11

BlueRaja - Danny Pflughoeft


There's not a lot of information in your question, but, generally speaking, this means that there is an incompletely defined association. It could be that you have tried to map one table with a foreign key to another table, but have not mapped that other table. You can also get this error when you try to do table per type inheritance without carefully following the steps for implementing that feature.

like image 36
Craig Stuntz Avatar answered Nov 15 '22 19:11

Craig Stuntz