4

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!

2 Answers 2

6

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.