如何使用实体框架代码第一个数据库进行增量开发.因为如果我更改某些类型的类型,它将重新生成数据库,该数据库可能会丢失数据库中已存在的数据.我正在使用DropCreate
DatabaseIfModelChanges.除此之外是否有任何东西可以执行alter quires而不是重新创建.
解决方法
EF Code First Migrations将在这里为您提供帮助,它目前在alpha / CTP:
Entity Framework Code First Migrations: Alpha,还可以查看
ADO.NET team blog:
The most consistent request we have heard from you since releasing EF 4.1 has been for a migrations solution for Code First that will incrementally evolve the database schema as you model changes over time. Today we are announcing the release of our first Community Technical Preview (CTP) of our Code First Migrations work.@H_502_8@