which way? Database-first , model-first , Code-Only?

笑着哭i 提交于 2019-12-05 15:27:44

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.

And here is a short (2 min) MSDN video on the primary differences and when to use what.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!