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.

image 

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

image

Click on the Properties you will get below window

image

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 .

image

You can see that the it auto generated .

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

Advertisements

6 thoughts on “Model code generation using Entity Framework and Visual Studio 2012 express

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s