哪一条路?数据库优先,模型优先,仅代码? [英] which way? Database-first , model-first , Code-Only?

查看:137
本文介绍了哪一条路?数据库优先,模型优先,仅代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我通过Pro Entity Framework 4.0书籍学习了Entity Framework ...



现在,我想用EF编写项目...这些条件و是哪种方式更好,更灵活吗?



我的意见是Model-first!但是我想知道你的意见?



谢谢!

解决方案

阅读这里: EF 4.1。哪种方式可以去?



根据您的喜好和情况进行排列。我的意见模仿了所说的话。如果您没有现有的数据库,而不喜欢视觉设计师,那么代码首先是为您而设。如果你有一个现有的数据库,数据库首先是有意义的。模型第一我一般来说避免了上面提到的情况覆盖我的需要,但有些人喜欢这种工作方式。



blurb也引用这篇的文章,如果你喜欢更深入。



编辑5/30/2011:



我将在这里添加新的 EF电动工具CTP1 。通过这种方式,您可以使用现有数据库并生成代码第一次设置。 这是一个快速的例子使用它。对于真正想要使用代码的人而言,这是一个很好的选择,但是已经建立了一个数据库。


recently I learned Entity Framework by Pro Entity Framework 4.0 book...

Now,I want to write the project by EF ...With these conditionsو which way is better and more flexible?

My opinion is the Model-first! however I want to know your opinion?

thanks!

解决方案

Read this: EF 4.1. Which way to go?

It goes through the permutations based on your preferences and situation. My opinion mimics what is stated. If you don't have an existing database and dislike visual designers, code first is for you. If you do have an existing database, database first makes sense. Model first I in general avoid as the cases mentioned above cover my needs, but some people enjoy that mode of work.

The blurb also references this article which goes more in depth if you like.

EDIT 5/30/2011:

I'm going to add in here the new EF Power Tools CTP1. With this you can take an existing database and generate a code first setup. Here's a quick example of using it. This is a good alternative for someone who really wants to use code first but has a database already built up.

这篇关于哪一条路?数据库优先,模型优先,仅代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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