我看到EF可以更新基于现有的数据库模式的典范。不过,我从头开始完全;我不想建表,然后重建的他们在EF模型文件。有没有办法,我可以绘制出一个模型文件,并自动为我创建的SQL表的方式吗?
I see that EF can update a model based on an existing database schema. However, I'm starting totally from scratch; I don't want to build tables, then rebuild them in the EF model file. Is there a way that I can draw out a model file, and have the SQL tables automatically be created for me?
推荐答案不幸的是,你必须等待英法2.0版本。
Unfortunately, you have to wait for version 2 of EF.
这里是一个链接到EF团队的博客,在那里他们谈论V2加入模型优先支持:
Here is a link to the EF team's blog, where they talk about adding Model First support in v2:
从一个实体框架V1最痛苦的疏漏之处是模型首先,这基本上意味着第一模式创建一个概念,然后推导出存储模型,数据库和映射从。
One of the most painful omissions from the Entity Framework V1 was Model First, which basically means creating a conceptual 'model first' and then deriving a storage model, database and mappings from that.
[...]
实体框架的下一个版本将包括从模型生成数据库模式的能力。主入口点此功能是通过设计上下文菜单,对此,我们将增加一个新的选项,称为从示范创建数据库。
The next release of the Entity Framework will include the ability to generate database schemas from your model. The main entry point into this feature is via the Designer context menu, to which we will add a new option called "Create Database from Model".
更多推荐
从实体框架模型构建数据库架构
发布评论