Model code generation using Entity Framework and Visual Studio 2012 express


It may happen for some project you have created the database and then connected it in your project using the Entity Framework , but after all successful process, no model classes are generated by default. here are the way to resolve it.

For Adventure Works , I got the below message and steps how I fixed it.


Go to model designer window and then right click on it. you will get the below menu


Click on the Properties you will get below window


Change the code generation strategy to Default,you can also update the Entity Container Name and Namespace, I have updated here.

save it and rebuild the solution. after that go to your designer file .


You can see that the it auto generated .

Thanks for reading , hope you find this post useful. 🙂