Reputation: 5615
Net MVC 3 web application. I generated my models from an existing database using "database first". But now, I would prefer to use the "code first" paradigm. Is that possible at all? How do I tell my solution that I want it to create tables for new models I code?
Upvotes: 1
Views: 560
Reputation: 30152
Yes but be aware this happens if your database doesn't exist.
Note the important part regarding your database creation: "This happens by default if your connection-string points to either a SQL CE or SQL Express database file that does not already exist on disk. You do not need to take any manual steps for this to happen."
So to add to an existing database this way - isn't going to happen.
Upvotes: 2