代码优先与模型/数据库优先[关闭] - Code-first vs Model/Database-first [closed]

问题:

What are the pros & cons of using Entity Framework 4.1 Code-first over Model/Database-first with EDMX diagram? 使用实体框架4.1代码优先于模型/数据库优先使用EDMX图表有什么优缺点? 数据库

I'm trying to fully understand all the approaches to building data access layer using EF 4.1. 我正在尝试彻底理解使用EF 4.1构建数据访问层的全部方法。 I'm using Repository pattern and IoC . 我正在使用Repository模式和IoC app

I know I can use code-first approach: define my entities and context by hand and use ModelBuilder to fine-tune the schema. 我知道我能够使用代码优先方法:手动定义个人实体和上下文,并使用ModelBuilder来微调模式。 框架

I can also create an EDMX diagram and choose a code generation step that uses T4 templates to generate the same POCO classes. 我还能够建立EDMX图并选择使用T4模板生成相同POCO类的代码生成步骤。 ui

In both cases I end up with POCO object which are ORM agnostic and context that derives from DbContext . 在这两种状况下,我最终都获得了与ORM无关的POCO对象和源自DbContext上下文。 spa

Database-first seems to be most appealing since I can design database in Enterprise Manager, quickly synch the model and fine-tune it using the designer. 数据库优先彷佛最吸引人,由于我能够在企业管理器中设计数据库,快速同步模型并使用设计器对其进行微调。 .net

So what is the difference between those two approaches? 那么这两种方法有什么区别? Is it just about the preference VS2010 vs Enterprise Manager? 是仅仅关于VS2010与企业管理器的偏好? 设计


解决方案:

参考一: https://stackoom.com/question/Mqpo/代码优先与模型-数据库优先-关闭
参考二: https://oldbug.net/q/Mqpo/Code-first-vs-Model-Database-first-closed
相关文章
相关标签/搜索