I'm working on updating an old system, and we're introducing Entity Framework for some new functionality. The system is, however, too large to do the migration in one step, so I would like to do some testing in another database before updating the db schema.
I have created an empty model, included a couple of tables from the database, and added a couple of new entities from scratch, along with relationships between these entities and the old tables. Now I want to create a new dat开发者_开发知识库abase schema in another database with my desing model, but I can't figure out how to switch so that clicking "Update database from model..." won't work with the old database, but the with the new one.
Is there a straight-forward way to do this?
In short, the connection settings are in your config file or a Data Connection. Entity Framework Connections and Models provides official documentation.
If your connection settings are in your config file, i.e. Web.config / App.config, you can change them there (additional documentation available in Entity Framework Config File Settings). If you used EF Designer to create your model, the option to save settings in the config file was in the Choose Your Data Connection Dialog Box (Generate Database Wizard).
If your connection settings aren't in a config file, they live in the Data Connection in the Server Explorer in Visual Studio: View > Server Explorer; expand Data Connections, right-click on the connection and choose Modify Connection.
精彩评论