-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Design: Allow open generic implementations of IDbContextFactory #8331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
A few more thoughts on this:
|
@bricelam in the snippet, the class is missing the generic argument 😸 |
We discussed in triage that we may want to morph this interface into something that facilitates discovery as well as instantiation of |
After further discussion today with @ajcvickers and @bricelam we came up with the idea that we could define an interface containing a method that returns the application's service provider for design time work. An implementation for the default template in ASP.NET Core 2.0 would just return This would enable EF Core to discover There several open questions around naming, where the interface should be defined and also where we want to drop the implementation in the template. |
Opened aspnet/DependencyInjection#524 which likely supersedes this issue. Clearing up milestone to decided if there is anything here we still want to pursue. |
Closing based on proposal in previous comment. |
Uh oh!
There was an error while loading. Please reload this page.
I'm still not sure if this is a good idea, but it sounds cool. Imagine the following.
Then, any context you used
.AddDbContext()
on inConfigureServices
would light-up at design-time without additional code.There is one big downside I can see to this: What if you don't want a particular context to use it? (e.g. you want it to use its own factory or just its default constructor.
The text was updated successfully, but these errors were encountered: