# EntityFramework Reverse POCO Code First Generator: database-first code for EF Core

> This T4 generator reads an existing SQL Server, PostgreSQL, MySQL, Oracle or SQLite database and writes Entity Framework Code First POCOs, configuration mappings, enumerations, a DbContext and a fake DbContext. Version 4 splits the work between a dotnet tool that reads the schema and a Visual Studio extension that writes the code, and commercial use needs a paid licence.

**ReversePOCO/EntityFramework-Reverse-POCO-Code-First-Generator** — EntityFramework Reverse POCO Code First Generator - Beautifully generated code that is fully customisable. This generator creates code as if you reverse engineered a database and lovingly created the code by hand. It is free to academics, commercial use requires a paid licence. Obtain your licence from:

- Repository: https://github.com/ReversePOCO/EntityFramework-Reverse-POCO-Code-First-Generator
- Website: https://www.reversepoco.co.uk/
- Stars: 715 · Forks: 227
- Language: C#
- License: NOASSERTION
- Published: 2026-10-21 · Updated: 2026-10-21 · Language: en
- Canonical page: https://hysenlabs.com/projects/reversepoco-entityframework-reverse-poco-code-first-generator

## Code first, generated from a database that already exists

The generator's pitch is unusual for a code first tool. It creates code as if an expert had reverse engineered the database and written the classes by hand, and the README is explicit that this is not the Microsoft reverse generator. The output covers the pieces a Code First project needs: POCO classes, Configuration mappings, Enumerations, the DbContext, a FakeDbContext for easy unit testing, and calls to stored procedures and table valued functions. The framing matters for how you judge the result. A code first generator normally starts from your model and creates the schema. This one starts from the schema and creates the model, which is the situation you land in when you inherit a database, when the schema is owned by another team, or when you want the generated classes to look hand-written rather than machine-shaped.

## Version 4 is two pieces, and you need both

The installation changed shape in v4 and the README explains why. You need the efrpg command line tool, which reads your database and is installed once per machine, and the Visual Studio extension, which generates the code from the Visual Studio Marketplace. The tool is a dotnet global tool.

```bash
dotnet tool install -g Efrpg
```

It needs the .NET 10 runtime, and it upgrades with dotnet tool update -g Efrpg. Then in Visual Studio you right-click the project, choose Add, then New Item, search for reverse poco and add it, set your connection string in the .tt file and save. The result is a template file in your project, and from that point the .tt file is the interface you work with. The README also documents a path for JetBrains Rider, where the extension is not needed: you add Database.tt and EF.Reverse.POCO.v4.ttinclude to the project and run the template, with the same output.

## Why the database read moved out of the Visual Studio process

This is the most valuable part of the v4 design and it is worth understanding before you debug anything. In v3, the T4 template opened the database connection itself, which meant loading a database provider assembly inside the Visual Studio T4 host. That is where the could not load file or assembly messages for Npgsql, MySql.Data or System.Data.SQLite came from, along with mismatches between the provider your project referenced and the one the T4 host found, and 32-bit versus 64-bit surprises. In v4 the tool reads the schema in its own process and hands the result back to the template, so provider versions are the tool's problem rather than your project's, and MySQL and Oracle are properly supported as a result. There is a security benefit too. The connection string is passed to the tool over stdin, so it stays out of process listings and command line audit logs.

## The .tt file is a settings file you are meant to edit

Customisation is the point of the tool, and the README says outright that it is designed to be customisable from the very beginning rather than fixed and rigid like other generators. The settings live in the database.tt file in your project, and you are told to play with them because that is what the file is for. If the database changes, you re-save the file and the output regenerates. A full list of features is available in the wiki under full control over the generated code. The upgrade path from v3 is designed to be gradual, since the include file is versioned in its filename, so v3 and v4 can sit side by side in one project and you can migrate one template at a time: point the .tt at EF.Reverse.POCO.v4.ttinclude and replace the block at the bottom of the file.

## Five databases, and the dialect quirks that will bite you

The supported list is SQL Server, PostgreSQL, MySQL, Oracle and SQLite. SQL Server Compact was removed in v4 because it reached end of support in July 2021 and has no provider for modern .NET, and if you still need it the README says to stay on v3. The reader is picked with the DatabaseType setting, and the connection string is passed straight to that provider, so anything the provider accepts works. The README then warns about three quirks that are worth internalising before you blame the tool. Against a local SQL Server you usually need Encrypt=false and TrustServerCertificate=true, because Microsoft.Data.SqlClient now defaults to encrypting. For Oracle there is no database name in the connection string at all: the user is the schema, and one run reads one schema. For MySQL a database is a schema, so the reader sees only the database you connected to.

## Licensing: free for academics, paid for everyone else

The licence is the one thing to settle before anything else, because it decides whether you may use the output. The README states that a licence key is required to remove trial limitations, that use is free to academics with an .edu, .ac or .sch email address, and that it is not free for commercial use. Keys come from the ReversePOCO website. The repository description says the same thing in a different way, that the tool is free to academics while commercial use requires a paid licence. GitHub reports the repository licence as a custom one it cannot classify, so the LICENSE file in the repository root is the authority on the actual terms, and the project keeps an efrpg-tool-briefing.md and planning documents at the root alongside the code. The licence also applies to what you generate, so a team that expects to ship the produced POCOs in a commercial product needs to read the file and get the key before generating.

## A Visual Studio extension with a large test matrix behind it

The repository layout shows how much testing sits behind the extension. There are several test projects: BuildTT.UnitTests, Efrpg.Gui.Core.Tests, Generator.Tests.Common, Generator.Tests.Integration, Generator.Tests.Unit and Generator.Tests.Unit.EFCore. Alongside them are integration test applications targeting several Entity Framework versions, with Tester.Integration.EFCore10, Tester.Integration.EFCore8, Tester.Integration.EFCore9 and Tester.Integration.Ef6, plus a business logic tester, a repository tester and TestDatabases. The source projects include BuildTT, Efrpg.Gui.Core, the EntityFramework Reverse POCO Generator directory, the generator core, an ItemTemplate directory for the Visual Studio integration, and a solution file named for the v4 generator. The releases are frequent, with v4.0.53 on 2026-10-14, v4.0.52 on 2026-10-01 and v4.0.51 on 2026-09-30, and the last push was on 2026-10-14.

## Conclusion

The Reverse POCO Generator fits a team taking over an existing database that has no usable model, or one that wants POCOs, mappings and a test-friendly fake DbContext generated together and then edited by hand. It does not fit a commercial project that has not budgeted for the licence, since free use is limited to academics, and it does not fit a team on Visual Studio 2017 or 2019, which need the v3 line. Verify first that your database and provider work with the connection string format shown for your dialect, install the efrpg tool before the extension because the extension alone cannot read the schema, and read the licence terms in the LICENSE file before distributing the generated code.

## FAQ

### How do I install the EntityFramework Reverse POCO Generator?

Version 4 needs two parts. Install the efrpg dotnet tool with dotnet tool install -g Efrpg, which needs the .NET 10 runtime, then install the Visual Studio extension from the Visual Studio Marketplace. In Visual Studio you add a reverse poco item to your project and set the connection string in the .tt file.

### Which databases does the Reverse POCO Generator support?

SQL Server, PostgreSQL, MySQL, Oracle and SQLite. SQL Server Compact was removed in v4 because it reached end of support in July 2021 and has no provider for modern .NET, and the README says to stay on v3 if you still need it.

### Is the Reverse POCO Generator free to use?

Free to academics, with an .edu, .ac or .sch email address, and not free for commercial use, where a licence key from the ReversePOCO website is required to remove the trial limitations. The repository licence is custom and GitHub cannot classify it, so read the LICENSE file for the exact terms.

### Can I use the generator with JetBrains Rider instead of Visual Studio?

Yes, without the extension. The README says to add Database.tt and EF.Reverse.POCO.v4.ttinclude to the project and run the template, which produces the same output. The v4 extension itself requires Visual Studio 2022 or later, and v3 remains available for Visual Studio 2017 and 2019.

## Sources

- [Issues](https://github.com/ReversePOCO/EntityFramework-Reverse-POCO-Code-First-Generator/issues)
- [Project website](https://www.reversepoco.co.uk/)
- [README](https://github.com/ReversePOCO/EntityFramework-Reverse-POCO-Code-First-Generator/blob/master/README.md)
- [Releases](https://github.com/ReversePOCO/EntityFramework-Reverse-POCO-Code-First-Generator/releases)
- [ReversePOCO/EntityFramework-Reverse-POCO-Code-First-Generator on GitHub](https://github.com/ReversePOCO/EntityFramework-Reverse-POCO-Code-First-Generator)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/reversepoco-entityframework-reverse-poco-code-first-generator
