Entity Framework Migration From Command Line

别来无恙 提交于 2020-01-05 08:37:35

问题


Is it possible doing some entity framework migration commands from a lightweight command line like visual studio cl?

I can't access to my remote sql express server from local visual studio so I can't add-migration and update-database commands. So if there would be a cl, I could solve my problem.


回答1:


There is a Migrate.exe tool which comes with EF which you can run through the command line.

Documentation for it can be found at: http://msdn.microsoft.com/en-us/data/jj618307.aspx

Used something like:

Migrate.exe MyApp.exe /startupConfigurationFile=”MyApp.exe.config” /targetMigration=”myTargetMigration”


来源:https://stackoverflow.com/questions/20692704/entity-framework-migration-from-command-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!