简体   繁体   English

在 EF Code-first 方法中总是需要重新部署连接到同一数据库的其他应用程序?

[英]In EF Code-first approach always need to re-deploy other application connected to same database?

I have multiple projects in one solution and I am only using one DBContext since I only have single database for all.我在一个解决方案中有多个项目,我只使用一个 DBContext,因为我只有一个数据库。 I have deployed those applications and they are now stable.我已经部署了这些应用程序,它们现在很稳定。 However, one of the project need to add a single column, then after changes made and migration to DB has been done, some of the projects got an error (Model Backing).但是,其中一个项目需要添加单个列,然后在进行更改并迁移到数据库后,一些项目出现错误(Model Backing)。 I need to update the .dll of all those application just to make it updated.我需要更新所有这些应用程序的 .dll 以使其更新。 I always do the same whenever there are enhancement or changes in one of my application.每当我的应用程序之一有增强或更改时,我总是这样做。

You will have to deploy it whenever there is some db change as you are using code first approach.当您使用代码优先方法时,只要有一些数据库更改,您就必须部署它。 Another way could be to disable automatic migration for all other projects which you don't want to redeploy.另一种方法是禁用您不想重新部署的所有其他项目的自动迁移。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM