Reverse Engineer a Database into
Entity Framework C# Code

Beautifully generated, fully customisable code that feels handwritten. Save time, reduce errors, and streamline your database integration.
Trusted by over 575,000 developers worldwide.

4.5 / 5 from 159 ratings on the Visual Studio Marketplace.

The free trial generates up to 10 tables and 10 stored procedures with no time limit. Academic use is free. Commercial use needs a licence.

Entity Framework Reverse POCO Code First Generator

Code That Feels Hand-Crafted

Tired of clunky, auto-generated code that's difficult to read and maintain? Our generator creates clean, elegant POCO classes, DbContext, and mappings as if an expert developer meticulously reverse-engineered your database by hand. The result is intuitive, high-quality code that seamlessly integrates into your projects.

We go beyond simple table-to-class mapping. The generator intelligently handles relationships, data types, and constraints, producing a robust data layer that you can trust. It's the perfect foundation for building scalable, testable and maintainable applications with Entity Framework.

Statistics

575K+
Developers Worldwide
6
Databases Supported
100%
Customizable Output
22+
Years of Development

Supported Technologies

Entity Framework

  • Entity Framework Core 10
  • Entity Framework Core 9
  • Entity Framework Core 8
  • Entity Framework 6

Databases

  • SQL Server
  • PostgreSQL
  • MySQL and MariaDB
  • Oracle
  • SQLite

IDEs

  • Visual Studio 2026
  • Visual Studio 2022
  • JetBrains Rider (template only, no dialogs)
  • Visual Studio 2017 and 2019 via version 3

Trusted by Developers Worldwide

Join a massive community of developers who rely on the Reverse POCO Generator to accelerate their workflow and build better software. With over half a million downloads, our tool has become an industry standard for Entity Framework database-first development, trusted for its reliability, power, and flexibility.

This widespread adoption means you benefit from a mature, battle-tested product with a wealth of community knowledge and support available. Save your precious time, maintain your sanity, and let the generator handle the tedious work of creating and maintaining your data access layer.

What's New in Version 4

The template no longer opens a database connection itself. It runs the efrpg dotnet tool, and the tool hands back your schema. That one change fixes the most common source of frustration with version 3.

  • No more provider assembly hell. "Could not load file or assembly Npgsql / MySql.Data / System.Data.SQLite", version mismatches between your project and the T4 host, 32-bit and 64-bit surprises: all gone. Provider versions are the tool's problem now, not your project's.
  • MySQL and Oracle are properly supported, not just listed.
  • No Visual Studio component prerequisite. Version 3 needed the Entity Framework 6 tools component. Version 4 does not.
  • Your connection string stays out of the logs. It is passed to the tool over stdin, never on a command line.
  • Visual Studio 2022 and 2026. Version 4 does not install on Visual Studio 2017 or 2019. Version 3 remains available for those.
  • Works in JetBrains Rider too. Add the template and include file to the project and run it from Rider's T4 menu. The dialogs are Visual Studio only; in Rider you edit the template. Rider setup.
  • Retired: SQL Server Compact, generating multiple DbContexts in one go, file-based Mustache templates and custom generator types. Version 3 remains available for projects that depend on them.

Already on version 3? The include file is versioned in its name, so both versions sit side by side in one project and you can migrate one template at a time. See Upgrading from v3 to v4.

Up and Running in Four Steps

  1. Install the efrpg tool. It reads your database and needs the .NET 10 runtime. Installed once per machine.
    dotnet tool install -g Efrpg
  2. Install the extension. Download the VSIX file and double-click it to install into Visual Studio 2022 or later.
  3. Add the template to your project. Right-click the project, choose Add, New Item, search for reverse poco and name the file, for example Northwind.tt.
  4. Point it at your database. The connection dialog opens as soon as the file is added. Paste the connection string, press Test connection, tick the tables you want, and the code is generated alongside the template. When the schema changes, save the .tt file to regenerate.

Your own code still needs the EF package for your database provider, for example Microsoft.EntityFrameworkCore.SqlServer.

See Reverse POCO in Action

Want the longer tour? The six-minute walkthrough goes through the settings and the generated code in more detail.

Comprehensive Database Reverse Engineering

Generate code that feels Hand-Crafted

This tool is your all-in-one solution for bridging an existing database with Entity Framework. It reverse engineers your database to generate everything you need to get started quickly and efficiently.

  • Clean, Plain Old CLR Objects for your tables and views
  • DbContext and interface, ready for dependency injection
  • Fluent API configuration classes
  • Stored procedures, table-valued and scalar-valued functions with typed return models
  • C# enumerations from table or view data
  • FakeDbContext for unit testing without a database
  • DbContext factory for design-time tooling and migrations
  • HiLo sequences and JSON column mappings
  • Filter the tables and views to the minimum set you need
  • Rename tables, columns, and stored procedures
  • Add custom interfaces and base classes to entities
  • Modify code generation using flexible {{Mustache}} templates

Expert-Quality Code

Generate code that feels Hand-Crafted.

Clean, maintainable, and follows best practices.

Fast-Starting DbContext

Generate only the tables, views and procedures a service needs. Smaller model, faster first query.

Ideal for microservices, AWS Lambda and Azure Functions. See the benchmark.

Fully Customisable

Complete control over the generated output. Edit settings in a searchable GUI dialog, each linked to its documentation.

Naming, filtering, output layout, base classes, interfaces and callbacks. It adapts to your codebase, not the other way around.

Six Databases

  • SQL Server
  • PostgreSQL
  • MySQL and MariaDB
  • Oracle
  • SQLite

Testing Ready

Generates a FakeDbContext that implements the same interface your business logic uses, so unit tests need no database and no mocking framework.

How to unit test EF Core without a database.

Stored Procedures and Functions

Typed calling methods and result classes for stored procedures, table-valued and scalar-valued functions.

No hand-written FromSqlRaw wrappers. How to call stored procedures in EF Core.

Optimise Performance with Precision Filtering

Filter, filter, filter!

Entity Framework builds its model the first time the DbContext is used - and the bigger the model, the longer that takes. A 500-table database produces a 500-entity context that can take several seconds to spin up before it runs a single query, and holds that entire model in memory for the life of the process. One of the most powerful features of our generator is the ability to include only the database objects you need: filter out the tables, views and procedures you don't, and you get a lean, fast-starting data context.

This fine-grained control is essential for large, complex databases with hundreds or thousands of tables. It ensures your application remains fast and responsive, loading only the metadata required for its operations. This approach simplifies your domain model and significantly improves the overall performance of your Entity Framework application.

This is key to having a fast EntityFramework - especially for microservices, AWS Lambdas and Azure Functions, where each service needs only a few tables but would otherwise rebuild the entire model on every cold start.

Try It Free. Buy It When It Earns Its Keep.

The trial generates up to 10 tables and 10 stored procedures and never expires. Academic use is free. When you are ready to generate the whole database, a per-developer licence unlocks everything.

Unlock the full generator with a Reverse POCO licence