I have an existing database. I was hoping there was a way to generate class files from this database. However, I seem to see a lot of generating the database from the class files.
Is there a way to generate class files from an existing database using the Entity Framework? If so how? Can someone point me to a tutorial?
This question is related to
c#
entity-framework
I found very nice solution. Microsoft released a beta version of Entity Framework Power Tools: Entity Framework Power Tools Beta 2
There you can generate POCO classes, derived DbContext and Code First mapping for an existing database in some clicks. It is very nice!
After installation some context menu options would be added to your Visual Studio.
Right-click on a C# project. Choose Entity Framework-> Reverse Engineer Code First (Generates POCO classes, derived DbContext and Code First mapping for an existing database):
Then choose your database and click OK. That's all! It is very easy.
EDMX model won't work with EF7 but I've found a Community/Professional product which seems to be very powerfull : http://www.devart.com/entitydeveloper/editions.html
Source: Stackoverflow.com