I found a solution using EF6 and Dotnet Core, which I'm pretty comfortable with.
It does not use the services.AddSqlServer () calls for EF7, but uses the EF6 configuration and registers the DbContext in the Bootstrap class invoked at startup.
public static class BootstrapConfig { public static void RegisterApplicationServices(this IServiceCollection services, IConfigurationRoot configuration) {
It is called from Startup.cs in a WebLibrary project as
public void ConfigureServices(IServiceCollection services) {

WebLibrary is a network-based network application with a grid point (contains controllers, this is a startup project).
Business logic is the level of service, and the middle tier is between the web application and the data access project.
Data access is where the dbContext and repository classes exist for actually executing the request.
The Model project contains POCOs and Enums, not smart objects, but containers that are used in the application.
The Bootstrap project has a link to business logic and data access projects so that it can register services and repositories for the IOC container.
Check out github repo for an example solution. One of the problems that I have for my application is this:
Despite the fact that the web library does not have a link to the data access project, I can still create an ApplicationContext instance from one of the controllers. The whole point is to separate these projects so that I can make it impossible to get the db context directly in the web project. I'm not sure if this is due to the new solution structure in Core, or if I include something that I don't know about.
source share