Is there an alternative to Code First Migrations with EF when all code changes are done by a DBA?

前端 未结 6 666
粉色の甜心
粉色の甜心 2021-02-06 03:04

I\'ve read about Code First Migrations but it seems that this is not really suited to the Enterprise.

We have a DBA that does all our Database changes and we don\'t nee

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-06 03:39

    Even though I use EF Code First style (as opposed to EDMX), I am still technically using a database first approach because I never let EF generate the database for me. Instead, I create the classes to model the database. This sounds like what you need to do in your case.

    As for the DBA changing things.. whether you need to update your domain entity classes depends on what it is that the DBA is changing. For example, if he is increasing the length of a varchar(100) to varchar(200) or something like that, then that change shouldn't really break your code (but it's still recommended you update your code to match this anyway). If he's removing or renaming some columns though, then you would definitely need to update your domain entity classes because that would obviously cause an exception regarding the underlying model not being in sync.

提交回复
热议问题