Scaffold tool: add a flag to generate the constructor with DbContextOptions injected #11570
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
type-enhancement
Milestone
Currently, scaffold existing database tool will generate an
OnConfiguringmethod with connection string inside:I realized this result is by-design to make the
the result of reverse engineering to be runnable(#10432), however, shouldn't there be an flag for people who needs an injectedDbContextOptionsinstead?--inject-dbcontextoptionsWith this flag, we can re-scaffold the context from existing database without touching the constructor again.
I mean, people who use EF Core in ASP.NET Core MVC app will tend to add the DB context into the service collection using
AddDbContextPool...The text was updated successfully, but these errors were encountered: