Add a connect string to your app.config. Somethine like:
The connection string you use must have at least these privileges: ddladmin, datareader and datawriter. ddladmin is required for reading the default constraints.
In Visual Studio, right click project and select "add - new item".
Select Online, and search for "reverse poco". Or you can download it from this page (use Download button at the top). By downloading and installing it, it will be permanently available in your "Add item" templates.
Select "EntityFramework Reverse POCO Generator".
Give the file a name, such as Database.tt and click Add.
Edit the Database.tt file and specify the connection string as "MyDbContext" which matches your connection string name in app.config.
Save the Database.tt file, which will now generate the Database.cs file.
There are many options you can use to customise the generated code. All of these settings are in the Database.tt files.