I am creating simple WebAPI and I would like to use 3 layer architecture
DAL -> Services -> API
DAL - DB context, entityes
Services - repositories, services and bussiness logic
API - API.Net Core 2 WebAPI
my question is how should I register DB Context into my Dependency Injector?
I have this line of code in startup.cs
var connectionString = Configuration["connectionStrings:libraryDBConnectionString"];
services.AddDbContext<LibraryContext>(o => o.UseSqlServer(connectionString));
but LibraryContext is placed in DAL project so I have to reference DAL project into my API project.
Is it correct implementation or should I use interface project with ILibraryContext?