You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OnConfiguring no longer has condition to check !optionsBuilder.IsConfigured #30168
After upgrading from EF Core 6 something to 7, it appears that scaffolding removes the condition in OnConfiguring - "if (!optionsBuilder.IsConfigured)" is no longer there. This causes the connection string that was used for scaffolding to always be used regardless of what is passed in for the options when setting up EF in program.cs in a web api for example. I know there is the --no-onconfiguring option but I was not using that with EF 6.
Was this intentional? If so, should it be considered a breaking change?
Oh god, some really messed up thinking in here. A couple of reasons why this was a terrible decision:
configuring context the way it used to work prior to EF Core 7 was used for years
the option you are referring to is obscure and almost nobody knows about it
most ASP.NET Core MS docs and community tutorials talk about providing the configuration through OnConfiguring and the DbContextOptionsBuilder instance
you failed to change the docs I just mentioned (a slew of ASP.NET Core/Worker apps/Console apps docs
you failed to document the change as a breaking change.
This is not the first time it seems as though the EF team lives in its own bubble, ignorant of other .NET parts.
The result: globally and universally wasted developer time.
Activity
ajcvickers commentedon Jan 29, 2023
This is by-design. The change is discussed here: ErikEJ/EFCorePowerTools#1647 (comment)
dcitak commentedon Jan 30, 2023
Thanks. Good to know. This would have been a breaking change for me if I had not noticed it.
There is a large discussion on the same thing here. Somewhere there I think is when the condition was added:
#10432
mhkolk commentedon Mar 1, 2023
Oh god, some really messed up thinking in here. A couple of reasons why this was a terrible decision:
This is not the first time it seems as though the EF team lives in its own bubble, ignorant of other .NET parts.
The result: globally and universally wasted developer time.