Entity Framework Generating model from database


Example

In Visual Studio go to your Solution Explorer then click on Project you will be adding model Right mouse. Choose ADO.NET Entity Data Model

enter image description here

Then choose Generate from database and click Next in next window click New Connection... and point to the database you want to generate model from (Could be MSSQL, MySQL or Oracle)

enter image description here

After you done this click Test Connection to see if you have configured connection properly (do not go any further if it fails here).

Click Next then choose options that you want (like style for generating entity names or to add foreign keys).

Click Next again, at this point you should have model generated from database.