Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Switching from entity framework model first to code first

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,

like image 287
Caribou Avatar asked Oct 17 '25 04:10

Caribou


1 Answers

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.

like image 165
Pawel Avatar answered Oct 18 '25 20:10

Pawel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!