All Projects → sjh37 → Entityframework Reverse Poco Code First Generator

sjh37 / Entityframework Reverse Poco Code First Generator

Licence: other
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 (you need a .edu or a .ac email address), not free for commercial use. Obtain your licence from

Projects that are alternatives of or similar to Entityframework Reverse Poco Code First Generator

Efdesigner
Entity Framework visual design surface and code-first code generation for EF6, Core and beyond
Stars: ✭ 256 (-54.45%)
Mutual labels:  entity-framework, visual-studio, code-generation
Devicemanager.api
Web API Framework demonstrates scalable, multitenant, architecture and allows building its own solution in the minutes. Uses: Entity Framework, UnitOfWork, Repository patterns. Wrapped in Docker, Kubernetes
Stars: ✭ 168 (-70.11%)
Mutual labels:  entity-framework, database
Pomelo.entityframeworkcore.mysql
Entity Framework Core provider for MySQL and MariaDB built on top of MySqlConnector
Stars: ✭ 2,099 (+273.49%)
Mutual labels:  entity-framework, database
Templates
CodeSmith Generator Templates
Stars: ✭ 52 (-90.75%)
Mutual labels:  entity-framework, code-generation
Efcore
EF Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations.
Stars: ✭ 10,838 (+1828.47%)
Mutual labels:  entity-framework, database
Frapper
ASP.NET Core 3.1 Beginners project template with complete Custom User Management and lot's of other useful Features Which Helps you for Rapid Application Development.
Stars: ✭ 129 (-77.05%)
Mutual labels:  entity-framework, database
Entityframework Extensions
Entity Framework Bulk Operations | Improve Entity Framework performance with Bulk SaveChanges, Insert, update, delete and merge for SQL Server, SQL Azure, SQL Compact, MySQL and SQLite.
Stars: ✭ 215 (-61.74%)
Mutual labels:  entity-framework, database
Ef6
This is the codebase for Entity Framework 6 (previously maintained at https://entityframework.codeplex.com). Entity Framework Core is maintained at https://github.com/dotnet/efcore.
Stars: ✭ 1,218 (+116.73%)
Mutual labels:  entity-framework, database
Boomerang
Boomerang Decompiler - Fighting the code-rot :)
Stars: ✭ 265 (-52.85%)
Mutual labels:  visual-studio, reverse-engineering
Rascal
The implementation of the Rascal meta-programming language (including interpreter, type checker, parser generator, compiler and JVM based run-time system)
Stars: ✭ 284 (-49.47%)
Mutual labels:  reverse-engineering, code-generation
Efcoreinaction Secondedition
Supporting repo to go with book "Entity Framework Core in Action", second edition
Stars: ✭ 96 (-82.92%)
Mutual labels:  entity-framework, database
Model
Ruby persistence framework with entities and repositories
Stars: ✭ 399 (-29%)
Mutual labels:  entity-framework, database
Filecontextcore
FileContextCore is a "Database"-Provider for Entity Framework Core and adds the ability to store information in files instead of being limited to databases.
Stars: ✭ 91 (-83.81%)
Mutual labels:  entity-framework, database
Entityframeworkcore.cacheable
EntityFrameworkCore second level cache
Stars: ✭ 138 (-75.44%)
Mutual labels:  entity-framework, database
Entityworker.core
EntityWorker is an object-relation mapper(ORM) that enable .NET developers to work with relations data using objects. EntityWorker is an alternative to entityframwork. is more flexible and much faster than entity framework.
Stars: ✭ 91 (-83.81%)
Mutual labels:  entity-framework, database
Tracker Enabled Dbcontext
Tracker-enabled DbContext offers you to implement full auditing in your database
Stars: ✭ 210 (-62.63%)
Mutual labels:  entity-framework, database
Efcore.pg
Entity Framework Core provider for PostgreSQL
Stars: ✭ 838 (+49.11%)
Mutual labels:  entity-framework, database
Entity Framework Code First Succinctly
This is the companion repo for Entity Framework Code First Succinctly by Ricardo Peres. Published by Syncfusion.
Stars: ✭ 18 (-96.8%)
Mutual labels:  entity-framework, database
Beef
Business Entity Execution Framework
Stars: ✭ 95 (-83.1%)
Mutual labels:  entity-framework, code-generation
Sapphiredb
SapphireDb Server, a self-hosted, easy to use realtime database for Asp.Net Core and EF Core
Stars: ✭ 326 (-41.99%)
Mutual labels:  entity-framework, database

EntityFramework Reverse POCO Code First Generator

Reverse engineers an existing database and generates Entity Framework Code First Poco classes, Configuration mappings and DbContext.

Beautifully generated code first code that is fully customisable

  • Downloadable VSIX installer from the visual studio gallery.
  • Watch the v2 in-depth course at pluralsight logo I cover everything the v2 generator can do, and show you step-by-step how to reverse engineer your database properly.

Please note, this is not the Microsoft reverse generator. This generator creates code as if you reverse engineered a database and lovingly created the code by hand. It also allows you to customise the generated code to your liking.

Watch a short video clip (no audio)

Watch the video

To remove trial limitations, you will require a licence key

Free to academics (you need a .edu or a .ac email address), not free for commercial use.

Go to the ReversePOCO website to obtain your licence key.

Upgrading v2 to v3

Please read the Upgrading documentation

What's new

Click here to see what's new in this release.

Supported databases

  • SQL Server
  • SQL Server Compact 3.5 and 4.0
  • PostgreSQL
  • Coming soon: Oracle, MySQL

Highly customisable output

This generator was designed to be customisable from the very beginning, and not fixed and rigid like other generators. Go and play with the settings in the <database>.tt file, that's what it's there for.

If your database changes, simply re-save the <database>.tt file. That's it.

Click here to see a full list of features.

To install and use this project:

  • Use Nuget and install the relevant nuget package for your database.

    • .Net Core: install-package Microsoft.EntityFrameworkCore.SqlServer
    • EF 6: install-package EntityFramework
  • Settings.ConnectionString is mandatory in v3, so you need to provide the connection string from your app.config/web.config/appsettings.json file. This connection string is used by the generator to reverse engineer your database. It no longer reads your connection strings from *.config files.

    For example:

    Settings.ConnectionString = "Data Source=(local);Initial Catalog=Northwind;Integrated Security=True";

  • The Settings.ConnectionString 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.

  • 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 full connection string in Settings.ConnectionString. This is used by the generater to read your database schema and reverse engineer it.

  • 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.

  • 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.

  • There are many options you can use to customise the generated code. All of these settings are in the Database.tt files.

Connection strings and how they are used

Settings.ConnectionString is mandatory in version 3. It is used by the generator to read your database schema. It's also placed into the generated code:

protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder){{#newline}}
{{{#newline}}
    if (!optionsBuilder.IsConfigured){{#newline}}
    {{{#newline}}
        optionsBuilder.UseSqlServer(@""{{ConnectionString}}"");{{#newline}}
    }{{#newline}}
}{{#newline}}{{#newline}}

Settings.ConnectionStringName Not used by the generator, but is placed into the generated DbContext constructor via a call to Settings.DefaultConstructorArgument.

public {{DbContextName}}(){{#newline}}
{{#if HasDefaultConstructorArgument}}
    : base({{DefaultConstructorArgument}}){{#newline}}
{{/if}}

UI

A simple UI for the generator is available at GitHub which helps you to create a regex to filter your tables.

Editing TT (T4) Files

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.

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.

Getting a pull request accepted

Have a read of [https://github.com/blog/1943-how-to-write-the-perfect-pull-request](How to write the perfect pull request)

My requirements are simple:

  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.
  2. No tabs, only spaces (4).
  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.
  4. Don't be tempted to do a few different enhancements in one pull request. Have one pull request for one bug fix / enhancement.

Regards, Simon Hughes

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].