Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building DB schema from Entity Framework Model

I see that EF can update a model based on an existing database schema. However, I'm starting totally from scratch; I don't want to build tables, then rebuild them in the EF model file. Is there a way that I can draw out a model file, and have the SQL tables automatically be created for me?

like image 323
Ana Betts Avatar asked Jul 28 '26 01:07

Ana Betts


1 Answers

Unfortunately, you have to wait for version 2 of EF.

Here is a link to the EF team's blog, where they talk about adding Model First support in v2:

One of the most painful omissions from the Entity Framework V1 was Model First, which basically means creating a conceptual 'model first' and then deriving a storage model, database and mappings from that.

[...]

The next release of the Entity Framework will include the ability to generate database schemas from your model. The main entry point into this feature is via the Designer context menu, to which we will add a new option called “Create Database from Model”.

like image 132
Erik Öjebo Avatar answered Jul 31 '26 05:07

Erik Öjebo



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!