Deploy Entity Framework Code First

后端 未结 2 492
无人及你
无人及你 2021-02-05 14:07

I guess I should have thought of this before I started my project but I have successfully built and tested a mini application using the code-first approach and I am ready to dep

2条回答
  •  甜味超标
    2021-02-05 14:20

    Here are the steps I follow.

    1. Comment out any Initialization strategy I'm using.
    2. Generate the database scripts for schema + data for all the tables EXCEPT the EdmMetadata table and run them on the web server. (Of course, if it's a production server, BE CAREFUL about this step. In my case, during development, the data in production and development are identical.)
    3. Commit my solution to subversion which then triggers TeamCity to build, test, and deploy to the web server (of course, you will have your own method for this step, but somehow deploy the website to the web server).
    4. You're all done!

    The Initializer and the EdmMetadata tables are needed for development only.

提交回复
热议问题