Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entity Framework - Error 11007: Entity type is not mapped.

I have a problem when I got the lasted .edmx.

I get a message that says Error 11007: Entity type 'pl_Micro' s not mapped. Looking at the designer view, I do see that this table does indeed exist.

How can I overcome this meesage?

like image 348
Nate Pet Avatar asked Feb 13 '13 17:02

Nate Pet


2 Answers

From MSDN:

Error 11007: Entity Type Is Not Mapped

This error occurs when an entity type in the conceptual model is not mapped to the data source. To resolve this error, map the entity type to the data source. Look at the MSDN link

How to: Map Entities to Database Tables

like image 182
Tabish Sarwar Avatar answered Sep 16 '22 14:09

Tabish Sarwar


I get this error when I move a database table to a different schema or delete a database table. In this case Entity Framework doesn't seem to update the edmx file correctly when you Update Model from Database....

The way I resolved this was to do a text search for the name of the offending entity. I then removed all references to this in the xml view of the edmx file, deleted the corresponding cs file that defines the entity, and any other references in the project.

like image 28
Giles Roberts Avatar answered Sep 16 '22 14:09

Giles Roberts