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
Commands: Discover contexts registered in the service provider #2293
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)?
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.
changed the title [-]Commands: ef context list doesn't show contexts registered using AddDbContext[/-][+]Commands: Discover contexts registered in the service provider[/+]on Sep 25, 2015
Activity
bricelam commentedon May 29, 2015
@ajcvickers commented in #2288:
[-]Commands: ef context list doesn't show contexts registered using AddDbContext[/-][+]Commands: Discover contexts registered in the service provider[/+]