Reputation: 299
I have a database and I want to make a model from it then later controllers and views. I went to "Models" folder then clicked on "Add New Item" but unable to find Entity Data Model. However Entity Framework 5 is already installed and reference is also present and I am using visual studio 2013 ultimate. I also tried nuget package manager but it is also confirming that Entity Framework is already installed. I think I am missing some thing or doing somthing wrong. Please help me how to generate a model from a database.
Upvotes: 1
Views: 4631
Reputation: 299
I uninstalled the visual studio and then installed it again. It solved my problem. Some components like visual studio database tools were not installed correctly. And it would also work if I would choose the repair option.
Upvotes: 1
Reputation: 22485
You'll need to creat an edmx file which captures your model from the database. the steps to do this are as follows:
To create an .edmx file from an existing database
this can be referenced more fully at: http://msdn.microsoft.com/en-us/library/vstudio/cc716703%28v=vs.100%29.aspx
[edit] - this is how the new item dialog should look:
Then when creating controllers/views, you just point to the required model in the select list, i.e:
Upvotes: 0