4

I'm working on a project using entity framework 6. At the start of the project I was a beginner with EF and choose to build with EF model first.

Now the model is quite big and I’m thinking about performance and ease to change the model without dropping the databases every time.

I thinking about switching to code first.

Given that model first has already generated all the classes I need and context, I don't think it's that difficult to switch to code first.

Nevertheless I would like to know what would be the best way to do that and if there will be real advantage in term of performance and ease of model modification.

Thanks for your help,

2
  • I believe you will still have to drop the DB when your models change no matter what. (though I hear there is a migration tool to update, but try this old thing called design, - think what you need before you start!) Commented Mar 27, 2014 at 22:00
  • performance of model is a separate question.eg msdn.microsoft.com/en-us/data/dn469601 see the EF site for more tips and ideas msdn.microsoft.com/en-us/data/ee712907 Commented Mar 28, 2014 at 6:30

2 Answers 2

4

EF 6.1 tooling now allows creating a Code First model from the database. Here is a short video and a walkthrough showing the functionality. You can download the latest EF tooling from the download center.

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

Comments

0

The code created by EDMX is not same as Fluent API although it is closed to Data Annotations.

If you would like to work with Fluent API, you can use Entity Framework Power Tools Beta 4 to generate to Fluent API from Database.

enter image description here

1 Comment

Reverse Engineering Code First is now included in the EF6.1 tooling - see this for more details msdn.microsoft.com/en-US/data/jj200620

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.