Skip to content
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

Commands: Discover contexts registered in the service provider #2293

Closed
bricelam opened this issue May 29, 2015 · 1 comment
Closed

Commands: Discover contexts registered in the service provider #2293

bricelam opened this issue May 29, 2015 · 1 comment
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@bricelam
Copy link
Contributor

(Reported by @glen-84 in #2256)

I'm able to add a DbContext from another assembly using services.AddEntityFramework().AddDbContext<My.ForumDbContext>(), but the context is not listed when you run dnx . ef context list – is it possible to make the migration tools see all DbContexts added in this manner (i.e. via the EntityFrameworkServicesBuilder)?

@bricelam
Copy link
Contributor Author

@ajcvickers commented in #2288:

Just a thought. When AddDbContext is called it will register the context in D.I. as both its specific type and as just DbContext. So if the AddDbContext mechanism is being used and only a single context type is being used, then the context instance (and its type) could be obtained from the service provider even without first knowing or discovering it. This might be advantageous for cases where the context is in a different assembly. But then again, it might be best just to take a more general approach to that scenario such that we always use the exact type name of the context class.

@rowanmiller rowanmiller modified the milestones: 7.0.0-rc1, 7.0.0 Sep 17, 2015
@bricelam bricelam changed the title Commands: ef context list doesn't show contexts registered using AddDbContext Commands: Discover contexts registered in the service provider Sep 25, 2015
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Oct 15, 2022
@ajcvickers ajcvickers modified the milestones: 1.0.0-rc1, 1.0.0 Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Projects
None yet
Development

No branches or pull requests

3 participants