Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tool to convert Entity Framework EDMX to Code First

Is there a tool to convert an edmx into code-first? I know there was talk of one appearing in a CTP a while back, but I can't find any updates relating to this.

There's a guy on the MSDN forums who has written his own (not available yet), but nothing from the EF team.

like image 752
SturmUndDrang Avatar asked Sep 07 '11 12:09

SturmUndDrang


People also ask

Is Entity Framework code First?

For those developers, Entity Framework has a modeling workflow referred to as Code First. Code First modeling workflow targets a database that doesn't exist and Code First will create it. It can also be used if you have an empty database and then Code First will add new tables to it.


1 Answers

With EF6 Tools & Visual Studio 2013 or Visual Studio 2012, you get the option code first from database (see screenshot below)

enter image description here

If you don't see this option you need to install Entity Framework 6 Tools for Visual Studio 2012 & 2013 http://www.microsoft.com/en-gb/download/details.aspx?id=40762

This doesn't convert an EDMX to code first (as requested in question), but it can create code first from an existing DB (which I assume someone wanted to do this from EDMX, would have an existing DB, unless they deleted their DB).

like image 73
DermFrench Avatar answered Sep 18 '22 13:09

DermFrench