Nigel Findlater
Nigel Findlater

Reputation: 1724

Using EF as an ORM after the EDMX is no longer supported

Currently I am using a database first approach where I reverse engineer the database using the EF designer from database to produce an EDMX file with pluralization. I then use the designer to produce C# compliant names and I then produce the corresponding POCOs. Updating a table was a little painful but it was possible while maintaining the ORM mappings already made in the EDMX.

I understand that future releases of EF will no longer support EDMX files.

How can I continue my database first approach using EF to convert database fields into C# complient objects eg PascalCasing for table names and camel casing for table properties?

Upvotes: 1

Views: 266

Answers (1)

Julie Lerman
Julie Lerman

Reputation: 4622

You can still reverse engineer an existing database even without the designer support. In fact, we've had this capability for a while with various tools (EF Power Tools (from MS), the the EF6 version of the EF Designer (from MS), ReversePoco (reversepoco.com). These all create a set of domain classes that look just like the db table schema and a dbcontext that wrap those classes.

WIth EF Core there's currently a migrations command called "Scaffold" that allows you to do the same...specify a database along with parameters to customize the operation... and generate domain classes and dbcontext.

Besides no visual designer for this, the other big difference is that it's a one shot deal. You can't udpate the model if the db changes. You'd either do that manually or be using the opposite: update the db if the model changes via migrations.

There are also other options such as DevArt's Entity Developer for working with a visual model for efcore and LLBLGen will have one soon as well.

HTH!

Upvotes: 1

Related Questions