You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Use Nuget and install the relevant nuget package for your datbase, such as `Microsoft.EntityFrameworkCore.SqlServer`
56
+
56
57
* The connection string you use must have at least these privileges: `ddladmin`, `datareader` and `datawriter`.
57
58
`ddladmin` is required for reading the default constraints.
58
59
* In Visual Studio, right click project and select "add - new item".
59
60
* Select Online, and search for **reverse poco**.
60
61
* Select **EntityFramework Reverse POCO Generator**.
61
62
* Give the file a name, such as `Database.tt` and click Add.
62
-
* Edit the `Database.tt` file and specify the connection string as "**MyDbContext**" which matches your name in `app.config`.
63
-
* Save the `Database.tt` file, which will now generate the `Database.cs` file.
64
-
* There are many options you can use to customise the generated code.
65
-
All of these settings are in the `Database.tt` files.
63
+
64
+
- .NET Core
65
+
* Edit the `Database.tt` file and specify the full connection string in `Settings.ConnectionString`. This is used by the generater to read your database schema and reverse engineer it.
66
+
* Edit the `Database.tt` file and specify the connection string in `Settings.ConnectionStringName` which matches the ConnectionString key as specified in your `appsettings.json`, `app.config` or `web.config`.
67
+
- EF 6
68
+
* Edit the `Database.tt` file and specify the connection string as "**MyDbContext**" which matches your name in `app.config`.
69
+
70
+
* Save the `Database.tt` file, which will now generate the `Database.cs` file. Every time you save your `Database.tt` file, the generator will run and reverse engineer your database.
71
+
* There are many options you can use to customise the generated code. All of these settings are in the `Database.tt` files.
66
72
67
73
### UI
68
74
@@ -72,20 +78,21 @@ A simple UI for the generator is available at
72
78
### Editing TT (T4) Files
73
79
To have full syntax highlighting and intellisense when editing TT files, I use the Resharper plugin ForTea. I can't imagine editing TT files without it.
74
80
81
+
With the new v3, you no longer have to edit the `EF.Reverse.POCO.v3.ttinclude` file as this file is now generated from a C# project. This repository includes the BuildTT file which creates the `EF.Reverse.POCO.v3.ttinclude` from the `Generator` C# project.
82
+
75
83
### Getting a pull request accepted
76
84
Have a read of [https://github.com/blog/1943-how-to-write-the-perfect-pull-request](How to write the perfect pull request)
77
85
78
86
My requirements are simple:
79
87
80
88
1. Always keep the changes to a **minimum**, so I can see **exactly** what's changed in regard to the pull request. I.e. No whitespace tidy up, etc.
81
89
2. No tabs, only spaces (4).
82
-
3. Don't move functions about, please leave them where they are.
83
-
4. No new files. This will always get rejected. Add any new code/classes into the two existing .ttinclude files.
84
-
5. Don't be tempted to do a few different enhancements in one pull request. Have **one** pull request for **one** bug fix / enhancement.
90
+
3. Edit the Generator C# project, as this is what is used to create the `EF.Reverse.POCO.v3.ttinclude` file. This repository includes the `BuildTT` project which creates the `EF.Reverse.POCO.v3.ttinclude` from the `Generator` C# project.
91
+
4. Don't be tempted to do a few different enhancements in one pull request. Have **one** pull request for **one** bug fix / enhancement.
0 commit comments