[Nightly] Base DbContext prefers parameterless constructor when injected #4784
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
type-bug
Milestone
As a result of #4750
It's only if I subclass and add a constructor that takes DbContextOptions as dependency and passes it into base that context is not null.
This is not consistent with previous alpha-beta-rc1-rc2uptolastweek behaviour, as well as Entity Framework 6's behaviour. As it's possible - using IModelCustomizer - to alter ModelBuilder from outside DbContext's OnModelBuilding method, it's used to be possible to have no application-specific DbContexts. In fact, to use Identity as anonymous, all one had to do previously is add IdentityContext! Not being able to do this violates L of SOLID.
This may potentially be relevant for DependencyInjection project.
The text was updated successfully, but these errors were encountered: