question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Having a prefix for generated Types in reverse engineering scaffold command

See original GitHub issue

What problem are you trying to solve?

I use ef core scaffolder to generate models from various databases. Some models may have the same names but they’re from different bounded contexts. For example, type Order has the same name in two databases but serves different purposes.

Describe the solution you’d like

I want to be able to add a prefix to type names when I generate models from each database. Something like:

dotnet ef dbcontext scaffold "<my connection string>" Microsoft.EntityframeworkCore.SqlServer -o SalesModels --type-prefix Sales

This should generate a type named SalesOrder for the table Orders in the Sales database.

I also would like to contribute to this feature. Thank you

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ErikEJcommented, Apr 27, 2021

EF Core Power Tools allows you to do renaming, including based on a reg ex.

0reactions
ajcvickerscommented, Apr 29, 2021

Note from triage: agreed that this is covered by #4038.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scaffolding (Reverse Engineering) - EF Core
Reverse engineering is the process of scaffolding entity type classes and a DbContext class based on a database schema.
Read more >
Entity Framework Core Customize Scaffolding
The advice is that once you have reverse-engineered your model from the existing database, you use migrations to keep the two in sync...
Read more >
Generating a model from an existing database
In this approach, you reverse-engineer a model from an existing database, ... You use the DbContext Scaffold command to generate the model.
Read more >
Using EF Core Code First with Existing Databases - YouTube
In this tutorial I'll teach you the reverse engineering method using EF Core Code First with the well-known Northwind database.
Read more >
EntityFrameworkRuler 1.2.22
CLI tool for creating and applying entity model rules used to align the Reverse Engineering output with a custom design such as that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found