实体框架4 - 从模型更新数据库模式。不擦拭表数据 [英] Entity Framework 4 - Update database schema from model. Without wiping the table data

查看:128
本文介绍了实体框架4 - 从模型更新数据库模式。不擦拭表数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个新项目,其中我使用Entity Framework 4从模型到数据库方法的工作。

I'm working on a new project where I have the luxury of working from a Model to Database approach using Entity Framework 4.

我正在工作的项目正在采取敏捷的方法,其中不同的阶段将随着时间推移。

The project I'm working on is taking an agile approach where different phases will be rolled out over time.

Model First方法是否适用于我的案例?我注意到当你从模型生成数据库时,它从头重新创建整个模式,这将明显擦除db中的所有数据。

Will the Model First approach work in my case? I noticed when you "Generate Database from Model" it recreates the entire schema from scratch which will obviously wipe all the data that is in the db.

我希望有一个更多的从模型更新数据库方法,其中的数据库只是更改以反映更改而不是重新创建。

I was hoping for a more "Update Database from Model" approach where the db would just be altered to reflect the changes rather than recreated.

有没有人在使用EF这种类型的工作流程中有任何经验?

Does anyone have any experience working in this type of workflow with EF?

感谢,

James Sheldon

James Sheldon

推荐答案

您希望数据库生成电源包

这篇关于实体框架4 - 从模型更新数据库模式。不擦拭表数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆