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
Decouple design time DbContext instantiaton from migrations commands #2357
Currently EntityFramework.Commands contains what we believed to be the implementation of EF command-line experience for DNX. However, the way we instantiate the application's DbContext (with all its dependencies wired up the same way they would be at runtime) is very ASP.NET specific and not generally applicable to all DNX code.
Issue aspnet/Hosting#286 was about decoupling that mechanism from ASP.NET Hosting but some of us met to analyze that option and came to the conclusion that that isn't the right approach. This issue describes a different way things can be decoupled:
EntityFramework.Commands should depend on an implementation of a contract that can load a context (we should considering keeping the shape and name of IDbContextFactory from EF6 or we can come up with something new). There could be several implementations of this interface, e.g.:
A standard one that mediates between ASP.NET Hosting and EF commands. It should live in its own package, e.g. EntityFramework.Commands.AspNet.
Potentially other standard ones for non-ASP.NET DNX applications
User defined (as with the old IDbContextFactory).
This "loader" would be specified in the registration of the EF commands in the project.json file, e.g.:
Activity
divega commentedon Jun 9, 2015
cc @bricelam @Tratcher
adamvoss commentedon Jun 29, 2015
Traditional .NET (non-DNX) support is relevant for us. No issues with
project.json, just wasn't sure if it would be read in a.csprojproject.http://stackoverflow.com/q/29110241/1072626
rowanmiller commentedon Sep 17, 2015
This is tracked by several other issues too