Search code examples
entity-frameworkvisual-studio-2013entity-framework-6.1

EF6 Model First: Unable to generate database from model after adding new entities


I created a new project and added an empty data model. I added a few entities and properties and then generated the database according to this tutorial. So far, so good. I then went back and added additional entitities.

Now, I am no longer able to Generate Database From Model... because I receive an Error 11007: Entity Type 'xxxx' is not mapped for all of the new entities I added. According to msdn, I can follow the instructions here to resolve my mapping issue between conceptual and storage models. However, it appears these instructions assume the entities are already present in my storage model (which they are not). When I try to manually map them, the only two tables I have to choose from are the original two tables I created.

I appreciate any help you can offer.


Solution

  • This was a phantom error of sorts. I had another error with a default value I was trying to set for a datetime that appeared at the bottom of my error list. I resolved this error and everything is now working as it should.